Language: PL/SQL Highlight Mode: PLSQL Last Modified: March 10th, 2009
CREATETABLE table_one (
col_one NUMBER,
col_two NUMBER);CREATETABLE table_two (
col_one NUMBER,
col_two NUMBER);INSERTINTO table_one VALUES(1,1);INSERTINTO table_one VALUES(3,5);INSERTINTO table_one VALUES(5,9);INSERTINTO table_two VALUES(4,5);INSERTINTO table_two VALUES(6,3);INSERTINTO table_two VALUES(5,5);SELECT*FROM
table_one t1 inner join
table_two t2 ON t1.col_one = t2.col_two;
COL_ONE COL_TWO COL_ONE COL_TWO
---------- ---------- ---------- ----------594535635955SELECT*FROM
table_one t1 inner join
table_two t2 using (col_two);-- Note: col_two is only returned once here instead of twice-- when using is used instead of on. This is because it must -- be the same value:
COL_TWO COL_ONE COL_ONE
---------- ---------- ----------534535