How do I use the current date in an HQL query with an Oracle database?

前端 未结 2 1145
说谎
说谎 2021-01-01 09:03

I\'m trying to write this query using Hibernate 3 and Oracle 10.

from Alert alert
where alert.expiration > current_date()
order by alert.priority, alert.         


        
2条回答
  •  别那么骄傲
    2021-01-01 09:42

    Is current_date() a Hibernate function?

    I would use sysdate instead. like this:

    where alert.expiration > sysdate 
    

    Or to ignore time of day:

    where alert.expiration > trunc(sysdate) 
    

提交回复
热议问题