|
with c
as(select level+1 n from dual connect by level<=13),
t(a,s,l)
as
(select cast(1+n as number(3)),cast('01'||','||lpad(n,2,0)||',' as varchar(30)),2 from dual,c
union all
select t.a+n,t.s||lpad(n,2,0)||',',l+1 from t,c
where instr(t.s,lpad(n,2,0||','))=0 and substr(t.s,-3,2)+substr(t.s,-6,2)+c.n between 21 and 24 and l<=9 and t.a<66
)
select count(s),min(a) from t where l=10; |
|