mysql 中我们可以通过 now() 函数来获取系统的当前时间。
但在 oracle 中并没有 now() 函数,相应的,我们需要使用 sysdate 函数来获取 oracle 数据库所在系统的当前时间。
更新当前时间
利用 sysdate 内置函数,我们可以很方便地更新当前时间的字段值:
update my_table set modify_time = sysdate where deleted = 0 and id = 'xxx'
查询当前时间
在 mysql 中,我们可以通过以下语句直接获取当前时间:
select now()
但在 oracle 中,from 关键字是必不可少的:
select sysdate from dual
推荐教程: 《oracle教程》
以上就是oracle怎么查询当前时间的详细内容。
