Which of the following set operators can be used to find all rows that are common in 2 queries?
Which of the following set operators can be used to find all rows that are common in 2 queries?
To find all rows that are common in two queries, the INTERSECT operator is used. INTERSECT returns only the rows that are present in both queries, including duplicates if the ALL keyword is used. Therefore, INTERSECT ALL is the correct operator for this purpose.
C is INCORRECT! "INTERSECT ALL" >>??
The correct answer is A - UNION. union all and intersect all will display the duplicates. Question is to find all rows that are in common ( Means distinct).
common means found both in a and in b. that is intersect.
The correct answer is C- Intersect. INTERSECT is used to match result sets between two tables. If the data is the same in both results sets, it passes through. When INTERSECT ALL is specified, the result consists of all rows that are in both results sets. If INTERSECT is specified without the ALL option, the duplicates will be removed from the results. Reference : https://www.datavail.com/blog/using-intersect-and-except-in-db2/