Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在H2数据库SQL查询中使用当前日期_Sql_H2 - Fatal编程技术网

如何在H2数据库SQL查询中使用当前日期

如何在H2数据库SQL查询中使用当前日期,sql,h2,Sql,H2,我需要像这样的东西 select * from tableName where date_column > now() 但是,now()在H2中不起作用。请告知。使用当前时间戳 select * from tableName where date_column > CURRENT_TIMESTAMP() 如果只想与当前日期进行比较,请使用 select * from tableName where date_column > CURRENT_DATE() 如果您还想与

我需要像这样的东西

select * from tableName where date_column > now()

但是,
now()
在H2中不起作用。请告知。

使用
当前时间戳

select * from tableName where date_column > CURRENT_TIMESTAMP()

如果只想与当前日期进行比较,请使用

select * from tableName where date_column > CURRENT_DATE()

如果您还想与当前日期和时间进行比较

select * from tableName where date_column > CURRENT_TIMESTAMP

在h2中,my select now()不起作用,但在update tbl set col=now()中起作用。这是如何结合在一起的?此外,他们还列出now()作为@john woo上当前_timestamp的替代,如果date_列的类型是date,而不是timestamp呢?我得到了
ORA-30088:datetime/interval精度超出了Oracle中
CURRENT\u TIMESTAMP()-date\u列的范围