... - Mailing list pgsql-hackers

From David Gilbert
Subject ...
Date
Msg-id 14323.25317.750866.864553@trooper.velocet.ca
Whole thread Raw
Responses ...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
OK... doing some serious report hacking... and I decided I wanted to
do this:

select acct_id,   sum(case when recd > ('now'::date - '30 days'::timespan)::date            then amt else 0) as current
 from payable where not paid_p group by acct_id order by acct_id;
 

but pgsql gives me:

ERROR:  parser: parse error at or near ")"

Now... I also thought I might be able to contruct 
sum(amt * <boolean>), but this also isn't allowed.  I think that we
should make an int(boolean) function.

Dave.

-- 
============================================================================
|David Gilbert, Velocet Communications.       | Two things can only be     |
|Mail:       dgilbert@velocet.net             |  equal if and only if they |
|http://www.velocet.net/~dgilbert             |   are precisely opposite.  |
=========================================================GLO================


pgsql-hackers by date:

Previous
From: Dmitry Samersoff
Date:
Subject: RE: [HACKERS] Win32 pЭort of libpq
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Regression tests on intel for 6.5.2