Which statement is true regarding the INTERSECT operator?

Which statement is true regarding the INTERSECT operator?

A. It ignores NULL values.

B. Reversing the order of the intersected tables alters the result.

C. The names of columns in all SELECT statements must be identical.

D. The number of columns and data   types must be identical for all SELECT statements in the query.

Answer: D

答案解析:

参考:http://blog.csdn.net/rlhua/article/details/12883007

A. 它忽略空值,错误,不会忽略空值

B. 交换交集表的前后顺序可以改变交集结果,错误,不会改变结果

C. 所有SELECT查询语句中的列的名字必须相同。错误,列名可以不必相同

D. 对于所有SELECT查询语句,列的数量和数据类型必须相同。

使用INTERSECT运算符可以返回多个查询的所有共同行。

准则

• 在查询中使用的所有SELECT语句中,由查询中的SELECT语句选定的列数和列的数据类型必须相同。不过,列名不必相同。

• 使相交的表按反方向排序不会更改结果。

• INTERSECT不会忽略NULL值。

---------------------

作者:Riveore

来源:CSDN

原文:https://blog.csdn.net/rlhua/article/details/12910975

版权声明:本文为博主原创文章,转载请附上博文链接!

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容