MySQL Forums
Forum List  »  Newbie

Re: Searching and Cross Referencing Multiple Tables
Posted by: Rick James
Date: February 23, 2009 11:31PM

My bad -- email is in table1.

... FROM (SELECT...)

Means to create a temporary table with that inner SELECT, then use that as the "table" from which to do the outer stuff.

FROM (SELECT ...) AS a
JOIN (SELECT ...) AS b
ON a.id = b.id

creates two tmp tables, then uses them (with "aliases" a and b) in a JOIN. This example is probably terribly inefficient since neither tmp table has an index on id.

These mean virtually the same thing:
FROM t1, t2 WHERE t1.id=t2.id
FROM t1 JOIN t2 ON t1.id=t2.id

Options: ReplyQuote


Subject
Written By
Posted
Re: Searching and Cross Referencing Multiple Tables
February 23, 2009 11:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.