全部博文(136)
分类: Oracle
2008-07-25 13:08:46
SQL> select * from t1;
A B C
---------- ---------- ---------- 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 9 rows selected
SQL> select * from t2;
A B C
---------- ---------- ---------- 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 SQL> select * from t3;
A B C
---------- ---------- ---------- 1 1 1 2 2 2 3 3 3 SQL> |
SQL> select t1.*, tx.*
2 from t1, (select t2.* from t2, t3 where t2.a = t3.a) tx 3 where t1.a = tx.a(+); A B C A B
C
---------- ---------- ---------- ---------- ---------- ---------- 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 9 rows selected |
SQL> select t1.*, t2.* from t1, t2, t3 where t1.a = t2.a(+) and t2.a =
t3.a;
A B C A B
C
---------- ---------- ---------- ---------- ---------- ---------- 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 SQL> select t1.*, t2.* from t1, t2, t3 where t1.a = t2.a(+) and t2.a =
t3.a(+);
A B C A B
C
---------- ---------- ---------- ---------- ---------- ---------- 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 9 rows selected
SQL> |