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!