Re: crosstab function - Mailing list pgsql-general

From Filip Rembiałkowski
Subject Re: crosstab function
Date
Msg-id AANLkTik4O+8aqfgZHKZQ1E7rXE9DtnseW=WrFxXRO7FY@mail.gmail.com
Whole thread Raw
In response to crosstab function  (Sim Zacks <sim@compulab.co.il>)
Responses Re: crosstab function  (Sim Zacks <sim@compulab.co.il>)
List pgsql-general
please show

- source data structures (in form of CREATE TABLE please)

- actual whole query that creates duplicates





2010/12/14 Sim Zacks <sim@compulab.co.il>
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?

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Loading different files
Next
From: Elliot Chance
Date:
Subject: Recreate C functions?