All Forums Database
c19 14 posts Joined 04/07
16 May 2007
Joining on multiple columns

Hi,I was wondering on a FULL JOIN what the difference between joining on one column and multiple say 10 or more?Thanks

vinod_sugur 22 posts Joined 04/05
16 May 2007

Hi,There is a DIFFERENCE check for the below given analysis:The concept of Full Outer join is to show data from both tables if matching row found and display NULL if no rows are found.Bb1 b2 b31 1 1 2 2 21 3 310 1 1Aa1 a2 a31 1 12 1 11 2 31 3 3you can try out below two queries and test the result, the result differs due to cross join in first query as the Unique Key for table A (a1,a2) and B(b1,b2).Select A.a1,A.a2,A.a3,B.b1,B.b2,B.b3 FRomA FULL OUTER JOIN B ONA.a1=B.b1Select A.a1,A.a2,A.a3,B.b1,B.b2,B.b3 FRomA FULL OUTER JOIN B ONA.a1=B.b1A.a2=B.b2From application point of view i would suggest you to put the matching conditions in Full Outer Join for both the tables.~Vinod

c19 14 posts Joined 04/07
16 May 2007

Thanks for the reply,if the any of the conditions fail on joining more than one column does all the columns display a NULL?

vinod_sugur 22 posts Joined 04/05
17 May 2007

YES~vinod

You must sign in to leave a comment.