Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fT7bU-0001eb-Oz for pgsql-sql@arkaria.postgresql.org; Wed, 13 Jun 2018 15:22:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fT7bT-0004c8-Cf for pgsql-sql@arkaria.postgresql.org; Wed, 13 Jun 2018 15:22:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fT7bT-0004bz-21 for pgsql-sql@lists.postgresql.org; Wed, 13 Jun 2018 15:22:31 +0000 Received: from mail.fmed.uba.ar ([157.92.152.1] helo=azteca.fmed.uba.ar) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fT7bO-00053y-OR for pgsql-sql@lists.postgresql.org; Wed, 13 Jun 2018 15:22:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by azteca.fmed.uba.ar (Postfix) with ESMTP id 22C0A1F61034; Wed, 13 Jun 2018 12:22:16 -0300 (-03) Received: from azteca.fmed.uba.ar ([127.0.0.1]) by localhost (azteca.fmed.uba.ar [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 43SaafadZ9AF; Wed, 13 Jun 2018 12:22:14 -0300 (-03) Received: from localhost (localhost.localdomain [127.0.0.1]) by azteca.fmed.uba.ar (Postfix) with ESMTP id E7FBC1F61070; Wed, 13 Jun 2018 12:22:14 -0300 (-03) X-Virus-Scanned: amavisd-new at fmed.uba.ar Received: from azteca.fmed.uba.ar ([127.0.0.1]) by localhost (azteca.fmed.uba.ar [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id k6njpGiQBNtk; Wed, 13 Jun 2018 12:22:14 -0300 (-03) Received: from azteca.fmed.uba.ar (azteca.fmed.uba.ar [157.92.152.1]) by azteca.fmed.uba.ar (Postfix) with ESMTP id BC9791F61034; Wed, 13 Jun 2018 12:22:14 -0300 (-03) Date: Wed, 13 Jun 2018 15:22:14 +0000 (UTC) From: Gerardo Herzig To: Olivier =?utf-8?Q?Lepr=C3=AAtre?= Cc: pgsql-sql Message-ID: <1021212329.270013.1528903334631.JavaMail.zimbra@fmed.uba.ar> In-Reply-To: <1229836812.269466.1528903219547.JavaMail.zimbra@fmed.uba.ar> References: <5b212b57.1c69fb81.2e3b4.1d26@mx.google.com> <5b2134ec.1c69fb81.7dd50.7e8f@mx.google.com> Subject: Re: Window ? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [157.92.152.1] X-Mailer: Zimbra 8.5.1_GA_3056 (ZimbraWebClient - FF52 (Linux)/8.5.1_GA_3056) Thread-Topic: Window ? Thread-Index: AdQDJnnwKQo8evXaRkq5VKU443DigwAAgyywZXeM7Ew= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ----- Mensaje original ----- > De: "Olivier Lepr=C3=AAtre" > Para: "pgsql-sql" > Enviados: Mi=C3=A9rcoles, 13 de Junio 2018 12:14:45 > Asunto: RE: Window ? > Thanks David, Gerardo, >=20 >=20 >=20 > I had a look to crosstab functions but wasn't able to make them work, > documentation is not precise enough to me, I would appreciate if someone = has a > working sample. Based on your suggestion, I will try again anyway. The ma= in > difficulty is that I have not only one column but half a dozen taht I wou= ld > like to appear >=20 >=20 >=20 > road 1 colA colB colC colD colE ColF colA colB colC colD colE ColF colA c= olB > colC colD colE ColF ... >=20 > road 2 colA colB... >=20 >=20 >=20 > for each road. >=20 Look at section 39.1.4. of https://www.postgresql.org/docs/current/static/t= ablefunc.html There is a working example that looks pretty close to what you want. HTH Gerardo