how Union keyword decide to remove duplicate value if there are multi column result set.

For eg: If I have two table with name and email_id column in both. And I want to make a union set from both the table , then my query will be SELECT name, email_id FROM table1 UNION SELECT name,email_id FROM table2 Then how this query work to remove duplicate records and from which column it will prefer to remove duplicate.. just curious to know this things..

13th Jul 2016, 2:32 AM
Sanjay Yadav
Sanjay Yadav - avatar
1 Answer
+ 1
If you have a record from each table with the same name and email, only one copy will be included in the union results.
13th Jul 2016, 4:36 PM
Igor B
Igor B - avatar