Re: [PHP] getting from one table listing from another
- From: larry@xxxxxxxxxxxxxxxx (Larry Garfield)
- Date: Mon, 20 Aug 2007 08:48:49 -0500
On Monday 20 August 2007, tedd wrote:
Question -- is it redundant to say:
FROM table a LEFT OUTER JOIN table b
ON(a.column = b.column)
when "table a" appears first? Wouldn't that be the same as:
FROM table a OUTER JOIN table b
ON(a.column = b.column)
???
I'm trying to understand why use LEFT and RIGHT if the tables' order
also has meaning.
Basically:
JOIN: Pull records from both tables.
LEFT OUTER JOIN: Pull records from both tables, but restrict the one on the
left (in the order of the SQL string's text).
RIGHT OUTER JOIN: Pull records from both tables, but restrict the ones on the
right (in the order of the SQL string's text).
INNER JOIN: Pull from both tables and restrict on both tables.
The join condition itself is what specifies how the tables should be joined.
The type of join specifies how the records should be restricted.
In practice I really don't remember the last time I used anything but INNER
JOIN or LEFT OUTER JOIN.
--
Larry Garfield AIM: LOLG42
larry@xxxxxxxxxxxxxxxx ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
.
- References:
- RE: [PHP] getting from one table listing from another
- From: "Jay Blanchard"
- RE: [PHP] getting from one table listing from another
- Prev by Date: Re: [PHP] Re: Pass $_GET to php cli.
- Next by Date: PHP eval() fatal error
- Previous by thread: RE: [PHP] getting from one table listing from another
- Next by thread: FW: [PHP] getting from one table listing from another
- Index(es):