Tuesday, January 5, 2016

Set Operations

  • Set Operations - Union, Intersect, Minus
This video discusses how to combine two sets of results together in SQL. The following SQL keywords are covered: UNION, UNION ALL, INTERSECT, MINUS, and EXCEPT.
The MINUS and EXCEPT commands are the same. Some databases use MINUS while other databases use EXCEPT.
http://www.1keydata.com/sql/union-intersect-minus-video.html

  •  difference between union,union all,intersect,minus
The purpose of the SQL UNION ALL command is to combine the results of two queries together
UNION vs UNION ALL
UNION and UNION ALL both combine the results of two SQL queries. The difference is that, while UNION only selects distinct values, UNION ALL selects all values.
http://www.1keydata.com/sql/sqlunionall.html

  • The purpose of the SQL UNION query is to combine the results of two queries together. In this respect, UNION is somewhat similar to JOIN in that they are both used to related information from multiple tables. One restriction of UNION is that all corresponding columns need to be of the same data type. Also, when using UNION, only distinct values are selected
http://www.1keydata.com/sql/sqlunion.html

  • Similar to the UNION command, INTERSECT also operates on two SQL statements. The difference is that, while UNION essentially acts as an OR operator (value is selected if it appears in either the first or the second statement), the INTERSECT command acts as an AND operator (value is selected only if it appears in both statements).
http://www.1keydata.com/sql/sql-intersect.html

  • The MINUS command operates on two SQL statements. It takes all the results from the first SQL statement, and then subtract out the ones that are present in the second SQL statement to get the final answer. If the second SQL statement includes results not present in the first SQL statement, such results are ignored.
http://www.1keydata.com/sql/sql-minus.html

No comments:

Post a Comment