Get Started
486

Q: What is UNION , UNION ALL?

  • Show Answer
  • Workspace

Answer :
Explanation :

Both these are used to combine the results of different SELECT statements.     UNION       - Selects only distinct values      UNION ALL - Selects duplicate values also   Syntax:     SELECT column_name(s) FROM table1     UNION / UNION ALL     SELECT column_name(s) FROM table2; Notice that each SELECT statement within the UNION must have the same number of columns. The columns must also have similar data types. Also, the columns in each SELECT statement must be in the same order.

The Most Comprehensive Exam Preparation Platform

Get the Examsbook Prep App Today