SQL Help (Joins) - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: SQL Help (Joins) (/showthread.php?tid=62075) SQL Help (Joins) by lordy on 06-30-2006 at 12:28 AM
Hey guys RE: SQL Help by Jhrono on 06-30-2006 at 12:38 AM
I found this page at w3schools.com, maybe it'll help you . I don't have the time to read it right now though RE: SQL Help by lordy on 06-30-2006 at 01:24 AM
I think I get it: RE: SQL Help (Joins) by Adeptus on 06-30-2006 at 02:10 AM
Your understanding is essentially correct. I will give you my definitions anyway, though. quote:An INNER JOIN returns a single joined row from the individual rows of joined tables, where the join conditions are met. Nothing is returned for rows in either table that do not meet the join conditions. quote:The full names for these are LEFT OUTER JOIN and RIGHT OUTER JOIN. An OUTER join returns all rows from one of the tables (LEFT or RIGHT relative to JOIN keyword and, of course, subject to any applicable WHERE clause). Where the other table has no rows that meet the join conditions (and WHERE clause, if any), the row from the designated (LEFT or RIGHT) table will still be returned in your results, but the values of joined columns from the other table will be NULL. Finally: 1) There is also a CROSS JOIN, which takes no conditions and returns all possible combinations of joined rows in both tables, subject to any applicable WHERE clause. 2) You don't necessarily have to SELECT any columns to return from a table involved in a join. You can still use INNER JOIN against another table to limit the returned results to those that match your join condition against said table. This trick often enables one to avoid using a subquery (although there is nothing wrong with using subqueries on databases that support them). 3) Using table aliases, you can join the same table to itself as many times as needed. This comes in handy when you have rows with a parent-child relationship contained in the same table, as well as for finding duplicates. RE: SQL Help (Joins) by lordy on 06-30-2006 at 02:36 AM Thanks heaps Adeptus |