select emptno,ename,sal,deptno,dname from emp e inner join dept d using(deptno); SQL> select e.empno,e.ename,e.sal,deptno,d.dname from 2 emp e inner join dept d using(deptno); EMPNO ENAME SAL DEPTNO DNAME ---------- ---------- ---------- ---------- -------------- 7369 SMITH 800 20 RESEARCH 7499 ALLEN 1600 30 SALES 7521 WARD 1250 30 SALES 7566 JONES 2975 20 RESEARCH 7654 MARTIN 1250 30 SALES 7698 BLAKE 2850 30 SALES 7782 CLARK 2450 10 ACCOUNTING 7788 SCOTT 3000 20 RESEARCH 7839 KING 5000 10 ACCOUNTING 7844 TURNER 1500 30 SALES 7876 ADAMS 1100 20 RESEARCH 7900 JAMES 1800 30 SALES 7902 FORD 3000 20 RESEARCH 7934 MILLER 1300 10 ACCOUNTING 7935 XIAOXUE 5000 20 RESEARCH
select... from table1 inner join table2 using(column1,column2)
select... from table1 inner join table2 on table1.column1=table2.column2 and table1.column2=table2.column2;
select... from table1 inner join table2 using(column1) inner join table3 using(column2);
上述的語句相當於下面的語句:
select... from table1,table2,table3 where table1.column1=table2.column1 and table2.column2=table3.table2;