Re: crosstab function

From: Filip Rembiałkowski <filip(dot)rembialkowski(at)gmail(dot)com>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: crosstab function
Date: 2010-12-14 08:27:34
Message-ID: AANLkTik4O+8aqfgZHKZQ1E7rXE9DtnseW=WrFxXRO7FY@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)compulab(dot)co(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Elliot Chance 2010-12-14 08:32:37 Recreate C functions?
Previous Message John R Pierce 2010-12-14 07:45:17 Re: Loading different files