On Fri, Nov 25, 2005 at 03:09:06PM +0100, Vittorio wrote:
> Dear all,

<snip>

> crosstab doesn't seem to work 
> anymore putting the above select into crosstab
> 
> switch=# select * from 
> crosstab('select rowid,attribute, sum(value) as val from ct1 group by 
> rowid, attribute order by 1,2;', 2) as c(rowid text, att1 integer, att2 
> integer);
> ERROR:  query-specified return row and actual function return 
> row do not match

It's just a guess, but I think the result of sum() might be a bigint,
in which case you should say that att1 and att2 are bigints, or
alternativly use cast(sum(value) as integer).

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgpHknzS4Ko7V.pgp
Description: PGP signature

Reply via email to