开发者

How to get the hour difference between 2 datetimestamp on derby db?

开发者 https://www.devze.com 2022-12-20 22:16 出处:网络
I have a sql question on derby database: Select a.name, a.starttime, a.endtime From a How can I add to the above sql statement such that I can get the difference in hours between the start time and

I have a sql question on derby database:

Select a.name, a.starttime, a.endtime
From a

How can I add to the above sql statement such that I can get the difference in hours between the start time and end time? (I only know that for mysql there is a DATEDIFF function, but I am not sure about what f开发者_Go百科unction should I use for derby db)

Thanks.


In Derby there is a TIMESTAMPDIFF:

for instance:

select {fn timestampdiff(SQL_TSI_FRAC_SECOND, startdate, enddate)} as diff 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号