Re: contrib/tablefunc crosstab
am 05.08.2004 20:18:51 von mailCaleb Simonyi-Gindele wrote:
> My problem is that the rows are populated from right to left irrespective of
> the column. So the $561.99 in vet1 actually belongs to vet2. There are never
> any blank cells in the middle or start of a row - they always come at the
> end. How do I get the amount for that date into the appropriate column?
You either need to be sure there are no "gaps" in your source rows
(provide one row for every category for each group, e.g. by doing an
outer join) or use the hashed version of the function. Search the README
for:
crosstab(text source_sql, text category_sql)
That is the hashed version that will do what you're looking for.
HTH,
Joe
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend