Performing Date/Time Math In HQL?

前端 未结 4 1864
粉色の甜心
粉色の甜心 2020-11-27 06:53

I\'m looking how to perform date/time math within an HQL query. Specifically, how do I add or subtract (x) amount of time from the result of the current_timestamp()

4条回答
  •  我在风中等你
    2020-11-27 07:29

    If you need the database server's time, you could first do a simple hql query to get the timestamp and then calculate the maxTimestamp in java and pass the fetched timestamp and the calculated maxTimeStamp to a query like the one of ccclark.

提交回复
热议问题