Home > Database > Oracle > body text

How to query the current time in oracle

hzc
Release: 2020-06-09 11:37:48
original
33498 people have browsed it

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'
Copy after login

Query the current time

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

SELECT NOW()
Copy after login

But in Oracle, the FROM keyword is essential:

SELECT SYSDATE FROM DUAL
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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 [email protected]
Latest issues
Popular Tutorials
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!