sqlh2

How to use current date in H2 database SQL query


I need something like

select * from tableName where date_column > now()

However, now() doesn't work in H2 Database Engine. Please advise.


Solution

  • use CURRENT_TIMESTAMP

    select * from tableName where date_column > CURRENT_TIMESTAMP()