October 12, 2005 at 5:02 pm
Helen Paolo
Victoria Pedro
2222 Pedro 1111
3333 Victoria 2222
4444 Helen 1111
where E.id = E1.mag_id
Helen Paolo
Victoria Pedro
October 12, 2005 at 5:11 pm
LEFT JOIN dbo.employee E ON E.id = E1.mag_id
_____________
Code for TallyGenerator
October 12, 2005 at 5:14 pm
The query will work but reading this article may give you a little more in depth knowledge about self referencing tables.
October 12, 2005 at 5:20 pm
Thanks Sergiy! I got it...It should be RIGHT JOIN...
October 13, 2005 at 4:48 am
Left of Right as the same - they are both OUTER joins.
Left or Right depends on which order you mention your tables.
FROM tableA LEFT JOIN tableB
is the same as
FROM tableB RIGHT JOIN tableA
but..
FROM tableA LEFT JOIN tableB
is NOT the same as
FROM tableA RIGHT JOIN tableB
Always be careful about which order tables are mentioned in outer joins.
/Kenneth
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply