Re: [BUGS] Problem With Case Statement and Aggregate Functions

2007-05-11 Thread Tom Lane
Andrew Shea <[EMAIL PROTECTED]> writes: > However the following code doesn't work even though it is very similar > to the first query (that is, and aggregate function within a case > statement): > select (SELECT CASE WHEN (1=2) THEN 0 ELSE COUNT(*) END) from ( ^^ > select 1 as cou

Re: [BUGS] Problem With Case Statement and Aggregate Functions

2007-05-11 Thread Klint Gore
On Fri, 11 May 2007 14:47:04 +1000, Andrew Shea <[EMAIL PROTECTED]> wrote: > The following works as expected: > > select (SELECT CASE WHEN (1=2) THEN 0 ELSE sum(count) END) from ( > select 1 as count union select 2 union select 3 > ) as "temp"; > > The result is "6". > > The following also work

[BUGS] Problem With Case Statement and Aggregate Functions

2007-05-11 Thread Andrew Shea
The following works as expected: select (SELECT CASE WHEN (1=2) THEN 0 ELSE sum(count) END) from ( select 1 as count union select 2 union select 3 ) as "temp"; The result is "6". The following also works as expected: select count(*) from ( select 1 as count union select 2 union select 3 ) as "