查询输入日期的一周日期

SELECT A.TMP_DATE, TO_CHAR(A.TMP_DATE, 'DL'), TO_CHAR(A.TMP_DATE, 'D'), CASE TO_NUMBER(TO_CHAR(A.TMP_DATE, 'D')) WHEN 1 THEN 7 ELSE TO_NUMBER(TO_CHAR(A.TMP_DATE, 'D')) - 1 END FROM (SELECT TO_DATE((SELECT NEXT_DAY(SYSDATE, '星期一') FROM DUAL) - LEVEL) AS TMP_DATE FROM DUAL CONNECT BY LEVEL < 8) A ORDER BY A.TMP_DATE

你可能感兴趣的:(Date)