A. Both USING and ON clauses can be used for equijoins and nonequijoins.
B. A maximum of one pair of columns can be joined between two tables using the ON clause.
C. The ON clause can be used to join tables on columns that have different names but compatible data types.
D. The WHERE clause can be used to apply additional conditions in SELECT statements containing the ON or the USING clause.
答案:(C、D)
解析:
|
--A(X), USING只能用于等值连接 --B(X), 可以指定多个pair of columns select e.empno, e.ename, e.deptno, d.loc from emp e join dept d on(e.deptno = d.deptno and d.deptno = e.deptno) where empno = 7788; --D --ON可以与WHERE一起使用 select e.empno, e.ename, e.deptno, d.deptno, d.loc from emp e join dept d on(e.deptno = d.deptno) where e.empno = 7788; EMPNO ENAME DEPTNO DEPTNO LOC ---------- ---------- ---------- ---------- ------------- 7788 SCOTT 20 20 DALLAS
--USING可以和WHERE一起使用 select e.empno, e.ename, deptno, d.loc from emp e join dept d using(deptno) where empno = 7788; EMPNO ENAME DEPTNO LOC ---------- ---------- ---------- ------------- 7788 SCOTT 20 DALLAS |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1156380/ ,如需转载,请注明出处,否则将追究法律责任。