[GENERAL] WITH AS vs subselect was: count (DISTINCT expression [ , ... ] ) and documentation

2008-12-26 Thread Ivan Sergio Borgonovo
On Fri, 26 Dec 2008 12:04:48 -0800 David Fetter da...@fetter.org wrote: On Fri, Dec 26, 2008 at 08:03:30PM +0100, Ivan Sergio Borgonovo wrote: aggregate_name (DISTINCT expression [, expression] ) In 8.4, you'll be able to do: WITH d AS ( SELECT DISTINCT c1, c2 FROM table1

Re: [GENERAL] WITH AS vs subselect was: count (DISTINCT expression [ , ... ] ) and documentation

2008-12-26 Thread Tom Lane
Ivan Sergio Borgonovo m...@webthatworks.it writes: David Fetter da...@fetter.org wrote: In 8.4, you'll be able to do: WITH d AS ( SELECT DISTINCT c1, c2 FROM table1 ) SELECT count(*) FROM d; Nice, but what will be the difference from select count(*) from (select distinct c1, c2 from t);

Re: [GENERAL] WITH AS vs subselect was: count (DISTINCT expression [ , ... ] ) and documentation

2008-12-26 Thread David Fetter
On Fri, Dec 26, 2008 at 07:13:48PM -0500, Tom Lane wrote: Ivan Sergio Borgonovo m...@webthatworks.it writes: David Fetter da...@fetter.org wrote: In 8.4, you'll be able to do: WITH d AS ( SELECT DISTINCT c1, c2 FROM table1 ) SELECT count(*) FROM d; Nice, but what will be the