transpose time-series columnar data - Mailing list pgsql-general

From Edu Gargiulo
Subject transpose time-series columnar data
Date
Msg-id CAD_UXMZ9boBnYQH-JQUrZoaiRb34AC1PO4V6L617aN7T7uXT7g@mail.gmail.com
Whole thread Raw
Responses Re: transpose time-series columnar data  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
Hi all,

I got a view that returns values in the following format

timestamp  |   name   |    value
---------------------------------
ts1            name1       value11
ts1            name2       value12
ts1            name3       value13  
ts2            name1       value21
ts2            name2       value22
ts2            name3       value23  
ts3            name1       value31
ts3            name2       value32
ts3            name3       value33  

I need to transpose and return one row for a single timestamp and one column for every name (fixed number of names), something like this

timestamp    |       name1      |        name2       |        name 3
-----------------------------------------------------------------------
ts1                  value11            value12              value13
ts2                  value21            value22              value23
ts3                  value31            value32              value33

Any help would be appreciated

Thanks and sorry for my english

--
Edu

pgsql-general by date:

Previous
From: Luca Ferrari
Date:
Subject: Re: Can't locate Ora2Pg.pm while executing export_schema.sh
Next
From: "David G. Johnston"
Date:
Subject: Re: transpose time-series columnar data