SELECT SUM (CASE
WHEN TRIM (TO_CHAR (TRUNC (SYSDATE, 'year') + LEVEL - 1,
'day'
)
) = 'saturday'
OR TRIM (TO_CHAR (TRUNC (SYSDATE, 'year') + LEVEL - 1,
'day'
)
) = 'sunday'
THEN '0'
ELSE '1'
END
) COUNT
FROM DUAL
CONNECT BY LEVEL <=
TRUNC (TRUNC (SYSDATE, 'year') + 366, 'year')
- TRUNC (SYSDATE, 'year')
WHEN TRIM (TO_CHAR (TRUNC (SYSDATE, 'year') + LEVEL - 1,
'day'
)
) = 'saturday'
OR TRIM (TO_CHAR (TRUNC (SYSDATE, 'year') + LEVEL - 1,
'day'
)
) = 'sunday'
THEN '0'
ELSE '1'
END
) COUNT
FROM DUAL
CONNECT BY LEVEL <=
TRUNC (TRUNC (SYSDATE, 'year') + 366, 'year')
- TRUNC (SYSDATE, 'year')
No comments:
Post a Comment