SQL 标准中是否存在 INTERSECT 运算符?
Does INTERSECT operator exist in the SQL standard?
SQL 标准中是否存在 INTERSECT 运算符?
如果存在,是否为可选运算符?
请留下可靠的来源。
你的教授要么错了,要么你误解了他们说的话。 SQL 的每个 实现 不支持 INTERSECT,但它是标准。
我检查了我的 "Understanding the New SQL: A Complete Guide" by Jim Melton and Alan R. Simon (1993) 副本,其中涵盖了 SQL-92。
第 171 页说:
The INTERSECT and EXCEPT Operators
INTERSECT returns all rows that exist in the intersection of two tables; that is, in both tables.
SELECT *
FROM music_titles
INTERSECT
SELECT *
FROM discontinued_albums;
The preceding query will return, for example, all discontinued albums that have been re-released.
这是 link 到 Google 的书籍,在搜索中突出显示了单词 INTERSECT:https://www.google.com/books/edition/Understanding_the_New_SQL/ZOOMSTZ4T_QC?bsq=intersect&gbpv=1
我还查看了 "SQL-99 Complete, Really" by Peter Gulutzan and Trudy Pelzer (1999) 的副本。它还记录了 INTERSECT.
INTERSECT
包含在 ANSI/ISO SQL 标准中 (ISO/IEC 9075-2:2016(E)) , 作为 可选 功能 F302:
F302 INTERSECT table operator
F302-01 INTERSECT DISTINCT table operator
F302-02 INTERSECT ALL table operator
SQL 标准中是否存在 INTERSECT 运算符? 如果存在,是否为可选运算符?
请留下可靠的来源。
你的教授要么错了,要么你误解了他们说的话。 SQL 的每个 实现 不支持 INTERSECT,但它是标准。
我检查了我的 "Understanding the New SQL: A Complete Guide" by Jim Melton and Alan R. Simon (1993) 副本,其中涵盖了 SQL-92。
第 171 页说:
The INTERSECT and EXCEPT Operators
INTERSECT returns all rows that exist in the intersection of two tables; that is, in both tables.
SELECT * FROM music_titles INTERSECT SELECT * FROM discontinued_albums;
The preceding query will return, for example, all discontinued albums that have been re-released.
这是 link 到 Google 的书籍,在搜索中突出显示了单词 INTERSECT:https://www.google.com/books/edition/Understanding_the_New_SQL/ZOOMSTZ4T_QC?bsq=intersect&gbpv=1
我还查看了 "SQL-99 Complete, Really" by Peter Gulutzan and Trudy Pelzer (1999) 的副本。它还记录了 INTERSECT.
INTERSECT
包含在 ANSI/ISO SQL 标准中 (ISO/IEC 9075-2:2016(E)) , 作为 可选 功能 F302:
F302 INTERSECT table operator
F302-01 INTERSECT DISTINCT table operator
F302-02 INTERSECT ALL table operator