Question: what is the difference between union and distinct in sql?
Answer: The difference between Union and Union all is that UNION ALL will not eliminate duplicate rows, instead it just pulls all rows from all tables fitting your query specifics and combines them into a table. ... If you select Distinct from Union All result set, Then the output will be equal to the Union result set.