[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    Re: [SQL] Can I simplify this somehow?
From:       Sergey Konoplev <gray.ru () gmail ! com>
Date:       2013-09-27 23:12:26
Message-ID: CAL_0b1uE8sUaKSqXra+3Wthdnkm5iJRJYC3e2pQ9xPC3SBoqhA () mail ! gmail ! com
[Download RAW message or body]

On Fri, Sep 27, 2013 at 12:32 PM, Larry Rosenman <ler@lerctr.org> wrote:
> On 2013-09-27 14:24, Adam Jelinek wrote:
>> TIME  MON   TUE  WED ...
>> 09:00     1        3       4
>> 10:00     5        0       8
>>
> That would be cool, but just a list is good too.....

You need to take a look at this module:

http://www.postgresql.org/docs/9.3/static/tablefunc.html

Particularly look at the crostab(text, text) function.

-- 
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic