Home  >  Article  >  Database  >  How to query the current time in oracle

How to query the current time in oracle

hzc
hzcOriginal
2020-06-09 11:37:4833697browse

How to query the current time in oracle

Oracle query the current time:

In MySQL we can get the current time of the system through the NOW() function.

But there is no NOW() function in Oracle. Correspondingly, we need to use the SYSDATE function to obtain the system where the Oracle database is located. current time.

Update the current time

Using the SYSDATE built-in function, we can easily update the field value of the current time:

UPDATE MY_TABLE
 SET MODIFY_TIME = SYSDATE
 WHERE DELETED = 0
   AND ID = 'XXX'

Query the current time

In MySQL, we can directly obtain the current time through the following statement:

SELECT NOW()

But in Oracle, the FROM keyword is essential:

SELECT SYSDATE FROM DUAL

Recommended tutorial: "Oracle Tutorial"

The above is the detailed content of How to query the current time in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn