How to calculate DATE Difference in PostgreSQL?

后端 未结 4 1397
既然无缘
既然无缘 2021-02-01 16:23

Here I need to calculate the difference of the two dates in the PostgreSQL.

In SQL Server: Like we do in SQL Server its muc

4条回答
  •  醉梦人生
    2021-02-01 17:20

    This is how I usually do it. A simple number of days perspective of B minus A.

    DATE_PART('day', MAX(joindate) - MIN(joindate)) as date_diff
    

提交回复
热议问题