Tab Alleman wrote:

SELECT SomeStuff
FROM Table1 AS T1
LEFT JOIN Table2 AS T2 ON T1.PK = T2.FK1
RIGHT JOIN Table3 AS T3 ON T2.FK2 = T3.PK
WHERE T1.PK=999

Either right-join it or reverse the table order (because you're not asking for data from "t1 that is like t2 that is like t3 that is like 999", you're asking for data "from t3 which has data ... in t2 which has data ... in t1 which has pk 999"

You have to think of the queries 'in order', left to right ... so that your LEFT join means what it should mean :). I rarely do right joins in small queries; it makes more sense to just reverse the query.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to