Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 708B51337B97 for ; Thu, 5 May 2011 17:53:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 93559-10 for ; Thu, 5 May 2011 20:53:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm5.bullet.mail.bf1.yahoo.com (nm5.bullet.mail.bf1.yahoo.com [98.139.212.164]) by mail.postgresql.org (Postfix) with SMTP id 379941337A5D for ; Thu, 5 May 2011 17:53:02 -0300 (ADT) Received: from [98.139.212.148] by nm5.bullet.mail.bf1.yahoo.com with NNFMP; 05 May 2011 20:53:02 -0000 Received: from [98.139.212.210] by tm5.bullet.mail.bf1.yahoo.com with NNFMP; 05 May 2011 20:53:02 -0000 Received: from [127.0.0.1] by omp1019.mail.bf1.yahoo.com with NNFMP; 05 May 2011 20:53:02 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 802609.26397.bm@omp1019.mail.bf1.yahoo.com Received: (qmail 9690 invoked by uid 60001); 5 May 2011 20:53:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1304628782; bh=K+VEcgAF3LiVL3Jsj4ygW2tGORvzAifwovvlCDMSILo=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=tSCiQ/w+dPjl2qkDOVaqRsqubt4n4bWrMY3YHc6ljPAigR46YDiZ72YzFBnKp6ILtHUqWSLOVrLaYzJACbCMBjwP87f+U39Ua0D5Upd6ch7w5ONoqVpqLBChcnuurSLc5d4ysIgSfrKBoFd6mWJ5Db1C6yEIddKlS8gnNI0380s= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=etTxn3X8aVcDOy4UmkyaSWoiqj9iASTCQXxw7Vo6Dfh2WJ4qSgN6xSu5taVGRP040aX3049X3OI7w3/2RcbV9es/Xyzd+iAB5qHDNufk3hMLCKToBNOm0TcLvVkh8H8kOih+BokiLeik3bDusiZ0w2syQwVNRT5DCYN9fQ88vf8=; Message-ID: <607516.4301.qm@web161318.mail.bf1.yahoo.com> X-YMail-OSG: oETvrH8VM1nGTU9WtDpiw.57_9sTY5j5tAZbGYh3LT1FSc7 kW3vUMuhWdGXqxw5ywmjBXLreb.HwlxILtIhr2NQhBXpThXsg6xzde2em8FD 6yPZyWtieMe508HRYh91ZyxHIgc8yio.VYmaptKRNMsoQBlI4TM8mH9kgIEz P.UlpXcCpsDPOuzFwiW_TJshim8imUOMS.UGV53qSDhEAjurCRgghNtNZ2Eo G8B6yuRW62oO8ofeyLKVJ3lThhLPjs4BW8nmR.xijXgWL0LS47hC_rRZPIdH iAm3wLI93_HEmryMhVmYog6yOkwCUR5CCNuoHeKTfyuSfC7EZ34Q_13ecBKZ LF6zjcG5OOyJeo2z0PUw61GUHDuM- Received: from [135.11.3.4] by web161318.mail.bf1.yahoo.com via HTTP; Thu, 05 May 2011 13:53:02 PDT X-Mailer: YahooMailClassic/12.0.2 YahooMailWebService/0.8.110.299900 Date: Thu, 5 May 2011 13:53:02 -0700 (PDT) From: Claudio Adriano Guarracino Subject: Select and merge rows? To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-506637682-1304628782=:4301" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=-5 required=5 tests=BAYES_40=-0.001, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/25 X-Sequence-Number: 35309 --0-506637682-1304628782=:4301 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Excuse me, The original table is: order=A0=A0=A0 ID=A0=A0=A0 value=A0=A0=A0=20 ---------------------- 1=A0=A0=A0 1000=A0=A0=A0 3 2=A0=A0=A0 1000=A0=A0=A0 5 3=A0=A0=A0 1000=A0=A0=A0 6 1=A0=A0=A0 1001=A0=A0=A0 1 2=A0=A0=A0 1001=A0=A0=A0 2 1=A0=A0=A0 1002=A0=A0=A0 4 2=A0=A0=A0 1002=A0=A0=A0 4 The result of table should be: id=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 value1=A0=A0=A0 value2=A0=A0=A0 value3 ---------------------------------------------------- 1000=A0=A0=A0=A0=A0=A0=A0 3=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 5=A0=A0 =A0 =A0 = =A0 =A0 6 1001=A0=A0=A0=A0=A0=A0=A0 1=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 2 1002=A0=A0 =A0=A0=A0=A0 4=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 4 Thanks! Regards, --- On Thu, 5/5/11, Claudio Adriano Guarracino wrote: From: Claudio Adriano Guarracino Subject: Select and merge rows? To: pgsql-sql@postgresql.org Date: Thursday, May 5, 2011, 4:18 PM Hello! I have a doubt about a query that I tried to do, but I cant...... This is the scenario: I have a table, with this rows: order=A0=A0=A0 ID=A0=A0=A0 value=A0=A0=A0=20 ---------------------- 1=A0=A0=A0 1000=A0=A0=A0 3 2=A0=A0=A0 1000=A0=A0=A0 5 3=A0=A0=A0 1000=A0=A0=A0 6 1=A0=A0=A0 1001=A0=A0=A0 1 2=A0=A0=A0 1001=A0=A0=A0 2 1=A0=A0=A0 1002=A0=A0=A0 4 2=A0=A0=A0 1002=A0=A0=A0 4 I need to get this table, divided by ID, like this: id=A0=A0=A0 value1=A0=A0=A0 value2=A0=A0=A0 value3 -------------------------------- 1000=A0=A0=A0 3=A0=A0=A0 5=A0=A0=A0 6 1001=A0=A0=A0 1=A0=A0=A0=0A 2 1002=A0=A0=A0 1=A0=A0=A0 2 How I can do this? I tried with cursors and view, but i can't.... Any help is welcome! Thanks in advance! Regards, --0-506637682-1304628782=:4301 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Excuse me,
The original table is:
order=     ID    value   
-------= ---------------
1    1000    3
2 &= nbsp;  1000    5
3    1000  = ;  6
1    1001    1
2  &= nbsp; 1001    2
1    1002   = ; 4
2    1002    4

The result of ta= ble should be:
id         &= nbsp;  value1    value2    value3
---= -------------------------------------------------
1000   =      3        &= nbsp;  5           6
1001        1   &nb= sp;       2
1002     &= nbsp;  4           4=

Thanks!
Regards,

--- On Thu, 5/5/11, Claudio Adriano G= uarracino <elninon@yahoo.com> wrote:

From: Claudio Adriano Guarracino <elninon@yahoo.com>
S= ubject: Select and merge rows?
To: pgsql-sql@postgresql.org
Date: Thu= rsday, May 5, 2011, 4:18 PM

Hello!
I have a doubt about a query that I tried = to do, but I cant......
This is the scenario:
I have a table, with th= is rows:
order    ID    value  &= nbsp;
----------------------
1    1000    3=
2    1000    5
3    100= 0    6
1    1001    1
2&= nbsp;   1001    2
1    1002 = ;   4
2    1002    4

I ne= ed to get this table, divided by ID, like this:
id    val= ue1    value2    value3
------------------= --------------
1000    3    5  &= nbsp; 6
1001    1   =0A 2
1002 &nb= sp;  1    2

How I can do this?
I tried with c= ursors and view, but i can't....
Any help is welcome!

Thanks in a= dvance!
Regards,

--0-506637682-1304628782=:4301--