oracle 自联接
来源:互联网 发布:中国软件上海分公司 编辑:程序博客网 时间:2024/06/05 05:26
127. Examine the data in the CUSTOMERStable:
CUSTNO CUSTNAME CITY
1 KING SEATTLE
2 GREEN BOSTON
3 KOCHAR SEATTLE
4 SMITH NEW YORK
You want to list all cities that havemore than one customer along with the customer details.
Evaluate the following query:
SQL>SELECT c1.custname, c1.city
FROM Customers c1 __________________Customers c2
ON (c1.city=c2.city ANDc1.custname<>c2.custname);
Which two JOIN options can be used inthe blank in the above query to give the correct output? (Choose
two.)
A. JOIN
B. NATURAL JOIN
C. LEFT OUTER JOIN
D. FULL OUTER JOIN
E. RIGHT OUTER JOIN
SQL> select c1.custname,c1.city from Customers c1 2 join 3 Customers c2 4 on (c1.city=c2.city and c1.custname<>c2.custname);CUSTNAME CITY---------- ----------KOCHAR SEATTLEKING SEATTLESQL> select c1.custname,c1.city from Customers c1 2 left outer join 3 Customers c2 on (c1.city=c2.city and c1.custname<>c2.custname);CUSTNAME CITY---------- ----------KOCHAR SEATTLEKING SEATTLEGREEN BOSTONSMITH NEW YORLSQL> select c1.custname,c1.city from Customers c1 2 right outer join 3 Customers c2 on (c1.city=c2.city and c1.custname<>c2.custname);CUSTNAME CITY---------- ----------KING SEATTLEKOCHAR SEATTLESQL> select c1.custname,c1.city from Customers c1 2 full outer join 3 Customers c2 on (c1.city=c2.city and c1.custname<>c2.custname);CUSTNAME CITY---------- ----------KOCHAR SEATTLEKING SEATTLEGREEN BOSTONSMITH NEW YORLSQL> select c1.custname,c1.city from Customers c1 2 natural join 3 Customers c2 on (c1.city=c2.city and c1.custname<>c2.custname);Customers c2 on (c1.city=c2.city and c1.custname<>c2.custname) *ERROR at line 3:ORA-00933: SQL command not properly endedCustomers c2 on (c1.city=c2.city and c1.custname<>c2.custname);
0 0
- oracle 自联接
- oracle联接
- SQL中的表联接之自联接
- oracle联接使用体会
- Oracle PL/SQL之联接
- ASP.NET联接ORACLE数据库
- oracle数据库中的联接查询
- oracle表联接(三)
- MYSQL: 临时表问题,不支持自联接
- 外联接、自联接与联合
- 联接
- 联接
- 联接
- 联接
- 联接
- 联接
- 联接
- 联接
- 清空easyui datagrid
- Stanford机器学习---第三讲. 逻辑回归和过拟合问题的解决 logistic Regression & Regularization
- STS(Eclipse)中配置hibernate连接Oracle数据库的方法详细描述
- 16进制字符串转换为10进制数字方法,负数的16进制需要BigInteger封装
- 移动端SEO的一些疑问
- oracle 自联接
- 自动对焦
- mfc程序只运行一个实例
- ubuntu 12.04 安装Rstudio-server
- linux 2.6内核较2.4内核中网络的改进分析
- IOS---Unix基本指令
- Stanford机器学习---第四讲. 神经网络的表示 Neural Networks representation
- 学习笔记-轻量级Java EE:模式--工厂方法和抽象工厂
- android自定义Application全局变量不能类型转换的问题