select to_char(t, 'yyyymm') a, to_char(t, 'yyyy-mm') b, to_char(t, 'dd') c
from (
select decode(level,
1,
trunc(sysdate, 'dd'),
add_months(trunc(sysdate, 'mm'), 2 - 1 * level) - 1) t
from dual
connect by level < 7
)
from (
select decode(level,
1,
trunc(sysdate, 'dd'),
add_months(trunc(sysdate, 'mm'), 2 - 1 * level) - 1) t
from dual
connect by level < 7
)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22569416/viewspace-2092651/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22569416/viewspace-2092651/