开发者

query to find difference between two time data record

I have a table that contains the following datetime and customer

example :

data1 :

datetime : 2011-7-25 10:23:30 AM

customer:A

data2 :

datetime : 2011-7-25 10:40:30 AM

customer:B

I need query to know tim开发者_开发知识库e duration between Customer A and B,

I am using Firebird database. thank you before


What about DATEDIFF?

SELECT DATEDIFF(second, -- or the unit you want
           a.datetime, b.datetime) AS result
FROM ExampleTable a, ExampleTable b
WHERE a.customer = 'A' and b.customer = 'B'
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜