你可以按下面这种方法做下去。SQL> select distinct a1.k,a2.k 2 from ( 3 select 1 as k from dual 4 union select 2 from dual 5 union select 3 from dual 6 ) a1, 7 ( 8 select 1 as k from dual 9 union select 2 from dual 10 union select 3 from dual 11 ) a2; K K ---------- ---------- 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 39 rows selected.SQL>
select * from(select rownum-1 a from all_objects where rownum<4)a, (select rownum-1 b from all_objects where rownum<4)b, (select rownum-1 c from all_objects where rownum<4)c, (select rownum-1 d from all_objects where rownum<4)d, (select rownum-1 e from all_objects where rownum<4)e, (select rownum-1 f from all_objects where rownum<4)f
2 from (
3 select 1 as k from dual
4 union select 2 from dual
5 union select 3 from dual
6 ) a1,
7 (
8 select 1 as k from dual
9 union select 2 from dual
10 union select 3 from dual
11 ) a2; K K
---------- ----------
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 39 rows selected.SQL>
from(select rownum-1 a from all_objects where rownum<4)a,
(select rownum-1 b from all_objects where rownum<4)b,
(select rownum-1 c from all_objects where rownum<4)c,
(select rownum-1 d from all_objects where rownum<4)d,
(select rownum-1 e from all_objects where rownum<4)e,
(select rownum-1 f from all_objects where rownum<4)f