Getting number of certain days-of-the-week (weekend) from interval in PostgreSQL

前端 未结 8 2213
轮回少年
轮回少年 2021-01-06 13:27

Given 2 timestamps in postgres, how do you calculate the time difference without counting whole Saturdays and Sundays?

OR

How do you count the number of Satu

8条回答
  •  灰色年华
    2021-01-06 14:02

    You might find this blogpost helpful: http://www.depesz.com/index.php/2007/12/27/how-many-1sts-of-any-month-were-sundays-since-1901-01-01/

提交回复
热议问题