Select and merge rows? - Mailing list pgsql-sql

From Claudio Adriano Guarracino
Subject Select and merge rows?
Date
Msg-id 607516.4301.qm@web161318.mail.bf1.yahoo.com
Whole thread Raw
List pgsql-sql
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="font: inherit;" valign="top">Excuse me,<br />The
originaltable is:<br />order    ID    value    <br />----------------------<br />1    1000    3<br />2    1000    5<br
/>3   1000    6<br />1    1001    1<br />2    1001    2<br />1    1002    4<br />2    1002    4<br /><br />The result
oftable should be:<br />id            value1    value2    value3<br
/>----------------------------------------------------<br/>1000        3           5           6<br />1001       
1          2<br />1002        4           4<br /><br />Thanks!<br />Regards,<br /><br />--- On <b>Thu, 5/5/11, Claudio
AdrianoGuarracino <i><elninon@yahoo.com></i></b> wrote:<br /><blockquote style="border-left: 2px solid rgb(16,
16,255); margin-left: 5px; padding-left: 5px;"><br />From: Claudio Adriano Guarracino <elninon@yahoo.com><br
/>Subject:Select and merge rows?<br />To: pgsql-sql@postgresql.org<br />Date: Thursday, May 5, 2011, 4:18 PM<br /><br
/><divid="yiv1952729686"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;"
valign="top">Hello!<br/>I have a doubt about a query that I tried to do, but I cant......<br />This is the scenario:<br
/>Ihave a table, with this rows:<br />order    ID    value    <br />----------------------<br />1    1000    3<br
/>2   1000    5<br />3    1000    6<br />1    1001    1<br />2    1001    2<br />1    1002    4<br />2    1002    4<br
/><br/>I need to get this table, divided by ID, like this:<br />id    value1    value2    value3<br
/>--------------------------------<br/>1000    3    5    6<br />1001    1    2<br />1002    1    2<br /><br />How I can
dothis?<br />I tried with cursors and view, but i can't....<br />Any help is welcome!<br /><br />Thanks in advance!<br
/>Regards,<br/><br /></td></tr></tbody></table></div></blockquote></td></tr></table> 

pgsql-sql by date:

Previous
From: Oliveiros
Date:
Subject: Re: Select and merge rows?
Next
From: Charlie
Date:
Subject: Re: [SQL] Select and merge rows?