DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Harish,
Join and Union cannot be compared as one is more advantageous than the other. The serve different functions.
Think of the union and join as concatenations.
A ?Union? concatenates ?rows? together and must have the same structure. So if you ?union? 2 tables together that have the same structure. Say both have 25 columns (need to match definition), one has 1000 rows and the other 2500 rows, the union will result in 3500 rows, or less depending upon if you use ?union all? or not.
A ?join? concatenates ?columns? together from multiple tables. So if you join 2 tables together, one with 25 columns and one with 50 columns, the resultant row will have 75 columns. Please read up on inner and outer joins for rules on how the joins work.
Dave |
|