日期:2014-05-16 浏览次数:20552 次
CREATE TABLE T ( ID VARCHAR2(1 BYTE) ); INSERT INTO T ( ID ) VALUES ( 'A'); INSERT INTO T ( ID ) VALUES ( 'B'); INSERT INTO T ( ID ) VALUES ( 'C'); COMMIT; SQL> select rownum from dual connect by rownum<10; ROWNUM ---------- 1 2 3 4 5 6 7 8 9 9 rows selected. SQL> select id,level from t connect by level<2; I LEVEL - ---------- A 1 B 1 C 1 SQL> select id,level from t connect by level<3; I LEVEL - ---------- A 1 A 2 B 2 C 2 B 1 A 2 B 2 C 2 C 1 A 2 B 2 I LEVEL - ---------- C 2 12 rows selected. SQL> select id,level from t connect by level<4; I LEVEL - ---------- A 1 A 2 A 3 B 3 C 3 B 2 A 3 B 3 C 3 C 2 A 3 I LEVEL - ---------- B 3 C 3 B 1 A 2 A 3 B 3 C 3 B 2 A 3 B 3 C 3 I LEVEL - ---------- C 2 A 3 B 3 C 3 C 1 A 2 A 3 B 3 C 3 B 2 A 3 I LEVEL - ---------- B 3 C 3 C 2 A 3 B 3 C 3 39 rows selected. SQL>