造假的周数。并去除重复的记录(2)

with w as(
select to_number(to_char(a3,'WW') ,'fm09')w from one),
w1 as(select ((select min(w) from w)+level-1)*7+to_date('20110101','YYYYMMDD') 
-to_number(to_char(to_date('20110101','YYYYMMDD'),'D') ,'fm0')L1
from dual connect by level<=(select max(w) from w)-(select min(w) from w)+2)
--select * from w1
,w2 as(select nvl(to_char(one.a3,'YYYYMMDD'),'/')a,to_char(L1+1,'YYYYMMDD')||'~'||to_char(L1+7,'YYYYMMDD')b,
decode(to_char(one.a3,'YYYYMMDD'),NULL,'未','已')||'报'c
from one right join w1 on one.a3 between L1+1 and L1+7 order by b)
select rownum,a,b,c from w2;

你可能感兴趣的:(C++,c,C#)