From: | Rod Taylor <rbt(at)rbt(dot)ca> |
---|---|
To: | Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de> |
Cc: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_get_triggerdef in pg_dump |
Date: | 2003-06-24 19:07:53 |
Message-ID: | 1056481672.67077.56.camel@jester |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> 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 <rbt(at)rbt(dot)ca>
PGP Key: http://www.rbt.ca/rbtpub.asc
From | Date | Subject | |
---|---|---|---|
Next Message | Jason Tishler | 2003-06-24 20:10:13 | Re: [HACKERS] ss_family in hba.c |
Previous Message | Bruce Momjian | 2003-06-24 19:04:05 | Re: [HACKERS] ss_family in hba.c |