crosstab function

From: Sim Zacks <sim(at)compulab(dot)co(dot)il>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: crosstab function
Date: 2010-12-14 07:17:44
Message-ID: 4D071A18.2060205@compulab.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

postgres 8.2.17

I am trying out the crosstab function (tablefunc contrib) for reporting
needs and I'm having a problem.
I have customers and products and the data is the quantity purchased. I
am grouping by customername, productname in the source sql. My category
sql depends if I want the products or customers to be the columns.

When I make customers the rows and products the columns, it works fine.
But when I make customers the columns and products the rows, there are
duplicate product rows.

Is there a way to group the product rows so that the data results come
back correct?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sven Krosse 2010-12-14 07:25:12 Loading different files
Previous Message Devrim GÜNDÜZ 2010-12-14 07:00:52 Re: postgresql 9 devel rpm