|
3#
SQL> with t as (select level n from dual connect by level <=11),
2 r as (select 'R' c from dual
3 union all
4 select 'Y' from dual
5 union all
6 select 'B' from dual),
7 s(lvl,nList,cList,nLast) as (select 1,cast(n as varchar2(30)),c,n
8 from t,r
9 union all
10 select s.lvl+1,
11 s.nList||','||t.n,
12 s.cList||','||r.c,
13 t.n
14 from s,t,r
15 where instr(s.nList,t.n)=0
16 and s.nLast < t.n
17 and s.lvl <5)
18 select count(*) from s
19 /
COUNT(*)
----------
143979 |
|