SELECT REPLACE(TO_CHAR(TRUNC(TO_DATE(‘2018-01-01’, ‘YYYY-MM-DD’) + (ROWNUM – 1) * 7,’D’) + 1,’YYYY-MM-DD’),’-‘,”) AS START_TIME,
FROM DUAL

CONNECT BY ROWNUM <=TRUNC(SYSDATE – TO_DATE(‘2018-01-01’, ‘YYYY-MM-DD’)) / 7 + 1

用to_char in

您必须 登录 才能发表评论