PIVOT of data - Mailing list pgsql-sql

From Srikanth Rao
Subject PIVOT of data
Date
Msg-id 20010314222916.11494.qmail@web6305.mail.yahoo.com
Whole thread Raw
Responses Re: PIVOT of data  ("Oliver Elphick" <olly@lfix.co.uk>)
List pgsql-sql
Hi, 
I have a table like this:      location        | numbrochures | marketing 
-----------------------+--------------+-----------101 Asheville, NC     |            4 | NEWS101 Asheville, NC     |
       1 | TV101 Asheville, NC     |            3 | RADIO101 Asheville, NC     |            2 | OTHER101 Asheville, NC
  |            3 | null101 Asheville, NC     |            1 | TV102 'Charlotte', 'NC' |            1 | SIGN104
'Colfax','NC'    |            5 | SIGN109 'Moyock', 'NC'    |            1 | BROCHURE
 
(9 rows)


I want the headings to be  like:

location | NEWS | TV | RADIO | OTHER | ........

How to get this done using sql for postgresql backend?

TIA,
Sri.

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/


pgsql-sql by date:

Previous
From: George Young
Date:
Subject: Re: need to join successive log entries into one
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: need to join successive log entries into one