Tuesday, 15 July 2014

FULL OUTER JOIN concept

I have 3 tables with some values.Some of the ID's are present in Table A,Some in Table B and other in Table C.I just want to know,what are the values present in one table are not present in another table.


SELECT A.ID,B.ID,C.ID
FROM A FULL OUTER JOIN B ON A.ID=B.ID
             FULL OUTER JOIN C ON A.ID=C.ID  OR B.ID=C.ID
ORDER BY A.ID,B.ID,C.ID                                                                                                                                                                                                                                     





It is easy only when you have understanding of JOINS concept in SQL.


No comments:

Post a Comment