Calculate difference between 2 dates in SQL, excluding weekend days

前端 未结 10 1028
礼貌的吻别
礼貌的吻别 2020-12-04 01:34

I would like to build an SQL query which calculates the difference between 2 dates, without counting the week-end days in the result.

Is there any way to format the

10条回答
  •  臣服心动
    2020-12-04 02:14

    I have found another way to do calculate the difference, by using only SQL :

    select sysdate - creation_dttm
    - 2 * (to_char(sysdate, 'WW') - to_char(creation_dttm, 'WW'))
    from the_table

提交回复
热议问题