Friday, September 20, 2013

How do you do many to many table outer joins?

SELECT * FROM foo
  LEFT OUTER JOIN (foo2bar JOIN bar ON (foo2bar.bid = bar.bid AND zid = 30))
  USING (fid);
Tested on MySQL 5.0.51.
This is not a subquery, it just uses parentheses to specify the precedence of joins.

No comments:

Post a Comment