2016-03-08 101 views

回答

3

如果你本身

select AGE('2016-04-26 00:00:00','2016-03-27 00:00:00') 
, AGE('2016-04-26 00:00:00','2016-03-26 00:00:00') 

運行年齡查詢,你會發現其結果是 30 days and 1 month

如果你是更精確,比較相同的時間間隔應該達到預期的結果。

select EXTRACT(EPOCH FROM (timestamp('2016-03-27 00:00:00') - timestamp('2016-04-26 00:00:00'))) 
, EXTRACT(EPOCH FROM (timestamp('2016-03-26 00:00:00') - timestamp('2016-04-26 00:00:00'))) 
相關問題