显示一年所有的星期一,星期天的sql

SELECT rq,to_char(rq,'day')

FROM   (SELECT trunc(SYSDATE, 'year') + ROWNUM - 1 rq

        FROM   dual

        CONNECT BY ROWNUM <= (trunc(SYSDATE, 'year') + INTERVAL '1' YEAR) - trunc(SYSDATE, 'year'))

WHERE  to_char(rq, 'd') IN (2,1)

你可能感兴趣的:(sql)