Stephan Szabo wrote:
>
> Probably you want something like:
> SELECT u.uid, u.txt, p.val FROM
> u INNER JOIN a ON (a.id=u.aid)
> LEFT JOIN p ON (p.uid=u.uid AND p.pkey=a.pkey);
From the docs:
A CROSS JOIN or INNER JOIN is a simple Cartesian product, the same as you get from
listing the two items at the top level of FROM. CROSS JOIN is equivalent to INNER JOIN ON
(TRUE), that is, no rows are removed by qualification. These join types are just a
notational convenience, since they do nothing you couldn't do with plain FROM and WHERE.
... so obviously there *is* something that INNER JOIN can do that regular ANDs can't. But
I'm still not clear why one works and the other doesn't.