Re: Bucketing Row Data in columns - Mailing list pgsql-sql

From Osvaldo Kussama
Subject Re: Bucketing Row Data in columns
Date
Msg-id 690707f60906251037h6d5dd0d5g333a981fef03e38f@mail.gmail.com
Whole thread Raw
In response to Re: Bucketing Row Data in columns  (James Kitambara <jameskitambara@yahoo.co.uk>)
List pgsql-sql
2009/6/25 James Kitambara <jameskitambara@yahoo.co.uk>:
>
> Hello Mr. Sandeep Bandela,
>
> I have gone through your scenario and come up with the following solution.
>
> SELECT USER_ID, CREATE_TIMESTAMP::DATE, SUM(AMOUNT)
> FROM ORDERS
> GROUP BY USER_ID, CREATE_TIMESTAMP
> ORDER BY USER_ID, CREATE_TIMESTAMP;
>
> Maybe you need to do little modification on the query to get what you want.
>


Contrib tablefunc/crosstab function may help you.
http://www.postgresql.org/docs/current/interactive/tablefunc.html

Osvaldo


pgsql-sql by date:

Previous
From: "Oliveiros Cristina"
Date:
Subject: Re: Bucketing Row Data in columns
Next
From: bricklen
Date:
Subject: Re: Bucketing Row Data in columns