JOINS, I suck at them.
Anyone know of any good tutorials for JOINS.
||11-05-2007 12:40 AM
||11-12-2007 05:30 PM
I thought I'd just extend onto that and give you an example of a few joins. There are:
- LEFT JOIN - Used to include data from the left table, but optional on the right table.
- RIGHT JOIN - Same as above just other way round.
- INNER JOIN - Used to include data that is present in both tables - so like an ID matching up to a foreign ID in the other table.
- NATURAL JOIN - Used to match up a pair of items from the 2 tables that have the same field name. ID to ID, for instance.
There are others like OUTER JOIN which I'm sure others will elaborate on, but the top 4 are what I use most :)
||11-14-2007 06:38 AM
just as a side note, not going to say ignorance is acceptable, but you'll rarely need to really
consider which type of join you will need. Often enough, it is adequate enough to just simple come up with a query that resembles :
(table1.specific_detail = table2.id)
table1.id = 5
and generally, this type of syntax will give you the results you desire.
But yes, learn the types of joins just in case things go.. askew.
|All times are GMT. The time now is 05:53 AM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0