[GENERAL] "UNION ALL" is failing

2011-08-26 Thread Joy Smith
column types are the same so I don't know why this 'union all' is failing. Any ideas? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - here is the error: ERROR: syntax error at or near "UNION" LINE 17: UNION ALL ^ ** Error ** ERROR: syntax error a

Re: [GENERAL] "UNION ALL" is failing

2011-08-26 Thread Joy Smith
from storage where monthly = '11-07' ) as b on a.node=b.node where a.accesses is null and b.channel = 'olam' Thanks again for the help. On Fri, Aug 26, 2011 at 9:52 AM, Tom Lane wrote: > Joy Smith writes: > > column types are the same so I don't know why thi

Re: [GENERAL] "UNION ALL" is failing

2011-08-26 Thread Joy Smith
PDATE | SHARE } [ OF table_name [, ...] ] [ NOWAIT ] [...] ] thanks again. On Fri, Aug 26, 2011 at 9:46 AM, Guillaume Lelarge wrote: > On Fri, 2011-08-26 at 09:28 -0400, Joy Smith wrote: > > column types are the same so I don't know why this 'union all' is > failing. > &g

[GENERAL] pivoting data?

2011-09-07 Thread Joy Smith
I finally understand why the query looks like it does, even though it is not what I wanted. Here is the setup: Version "PostgreSQL 9.0.4, compiled by Visual C++ build 1500, 32-bit" Table Structure -- Table: modvalues --

Re: [GENERAL] pivoting data?

2011-09-08 Thread Joy Smith
3 thank you for your help and ideas On Wed, Sep 7, 2011 at 6:38 PM, Chris Travers wrote: > On Wed, Sep 7, 2011 at 3:25 PM, Joy Smith > wrote: > > I finally understand why the query looks like it does, even though it is > not > > what I wanted. Here is the setup: > >

Re: [GENERAL] pivoting data?

2011-09-08 Thread Joy Smith
>You'll want to group by baloons,color and probably take a sum of each of the case statements. >Sim yes, hard to believe I did not notice that. Thank you, the working query is: select baloons, color, max(case when dayofpurchase = '2011-01-01' then amountpur ELSE NULL END) as "first", max(CASE w