oracle查年度周末日期
1.查年度周末日期sql
SELECT distinct
TRUNC(TO_DATE('2019-01-01','yyyy-mm-dd')+ rownum,'iw')+ 5 AS sat,
TRUNC(TO_DATE('2019-01-01','yyyy-mm-dd')+ rownum,'iw')+ 6 AS sun
FROM
dual
where instr(to_char(sat),'2020')=0
AND instr(to_char(sun),'2020')=0
CONNECT BY
rownum <=(TO_DATE('2019-12-31','yyyy-mm-dd')-TO_DATE('2019-01-01','yyyy-mm-dd'))
ORDER BY sat,sun;