select COUNT(daylist)
from (
SELECT TO_CHAR(TO_DATE('2019-03-01', 'yyyy-MM-dd') + ROWNUM - 1,
'yyyyMMdd') as daylist
FROM DUAL
CONNECT BY ROWNUM <=
trunc(to_date('2019-03-31', 'yyyy-MM-dd') -
to_date('2019-03-01', 'yyyy-MM-dd')) + 1
)
where to_char(to_date(daylist, 'YYYYMMDD'), 'd') not in ('1', '7')
你参考看看