View previous topic :: View next topic
|
Author |
Message |
Wilfred Currently Banned New User
Joined: 06 Feb 2007 Posts: 5 Location: bangalore
|
|
|
|
Hi All
Can any one tell me how to eliminate duplicate rows from two tables? please! i know to eliminate duplicate rows from a table we can use DISTINCT. but for from two tables?
Thank you
Regards
Wilfred |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I obviously do not understand because my first suggestion would be to use two DISTINCTs.....But I don't expect that is what you want....
Could you expand on the problem a little? |
|
Back to top |
|
|
Wilfred Currently Banned New User
Joined: 06 Feb 2007 Posts: 5 Location: bangalore
|
|
|
|
Hi
i mean to say, i have tableA and tableB, and i want to eliminate duplicate rows from these two tables.
I think we can use logic UNION and UNION ALL
UNION IS FOR TO ELIMINATE DUPLICATE ROWS AND
UNION ALL IS GET THE DUPLICATE ROWS.
CORRECT ME IF AM WRONG!
THANKS
WILFRED! |
|
Back to top |
|
|
rajeshps19
New User
Joined: 14 Feb 2007 Posts: 4 Location: Noida
|
|
|
|
Hi Wilfred,
Yes, that's right.
UNION will eliminate all duplicate rows whereas UNION ALL will retain them.
Rajesh. |
|
Back to top |
|
|
|