SQL Database Concepts Question:
Download Job Interview Questions and Answers PDF
Explain what is the difference between UNION and UNION ALL?
Answer:
UNION selects only distinct values whereas UNION ALL selects all values and not just distinct ones.
UNION: SELECT column_names FROM table_name1
UNION
SELECT column_names FROM table_name2
UNION All: SELECT column_names FROM table_name1
UNION ALL
SELECT column_names FROM table_name2
UNION: SELECT column_names FROM table_name1
UNION
SELECT column_names FROM table_name2
UNION All: SELECT column_names FROM table_name1
UNION ALL
SELECT column_names FROM table_name2
Download Basic SQL Server Interview Questions And Answers
PDF
Previous Question | Next Question |
Can you explain what are COMMIT and ROLLBACK in SQL? | Tell me what is a Linked Server? |