Calculating difference of dates In Postgresql

后端 未结 3 1389
忘了有多久
忘了有多久 2021-01-17 15:34

I\'m trying to find out the time between certain fields in my tables. However cause I\'m using Postgresql :(( I can\'t use the DATEDIFF function. I can\'t f

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-17 16:12

    You don't need a "datediff" function.

    Just subtract the two dates:

    Question.LoggedTime - MIN(qUpdate.UpdateTime)
    

    In case you don't know, but all that is documented online:
    http://www.postgresql.org/docs/current/static/functions-datetime.html

提交回复
热议问题