Union will return record only once even if it occurs several times. Union all will give a record as many times as it occurs. So union and union all will behave the same when each record is distinct in all the participating tables.
eg
select name, id from Emp1 union select name, id from Emp2
select name, id from Emp1 union all select name, id from Emp2
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Union will return record only once even if it occurs several times. Union all will give a record as many times as it occurs. So union and union all will behave the same when each record is distinct in all the participating tables.
eg