> SELECT foo > FROM bar b > LEFT JOIN chair c USING (thekeycol) > WHERE ... > :-)
Sub-selects are much nicer:
SELECT foo
, bar
, (SELECT anotherfoo
FROM tab2
WHERE tab2.col = tab1.col)
FROM tab
JOIN yet_another_table AS yat
ON (yat.c = tab.c)
LEFT JOIN tab1 USING (anothercol)
WHERE stuff IS TRUE
AND ( optional IS NULL
OR optional > 5)
HAVING count(*) > (SELECT total
FROM total_table)
ORDER BY foo
GROUP BY foo
, bar
, 3;
--
Rod Taylor <[EMAIL PROTECTED]>
PGP Key: http://www.rbt.ca/rbtpub.asc
signature.asc
Description: This is a digitally signed message part
