MySQL Forums
Forum List  »  Newbie

Re: Select * From t1,t2 ON a=b problem
Posted by: Rick James
Date: March 17, 2009 08:52PM

These patterns are the same:
  FROM a,     b WHERE a.id = b.id
  FROM a JOIN b    ON a.id = b.id

LEFT JOIN lets you get rows from the left table that have no corresponding row in the right table:
  FROM a LEFT JOIN b  ON a.id = b.id
    WHERE b.id IS NULL

Warning. Precedence can be a problem. The first of these is the same as one of the others (depending on the version of MySQL):
  FROM  a, b  JOIN c ON ...
  FROM (a, b) JOIN c ON ...
  FROM  a, (b JOIN c ON ...)

Options: ReplyQuote


Subject
Written By
Posted
Re: Select * From t1,t2 ON a=b problem
March 17, 2009 08:52PM


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.