From: Gianni Ciolli <gianni.ciolli@2ndquadrant.it>
To: pgsql-it-generale@postgresql.org
Subject: Re: query concatenate
Date: Fri, 1 Mar 2013 13:04:26 +0100
Message-ID: <20130301120426.GD3079@756b4.gi.lan> (raw)
In-Reply-To: <DUB108-W51773E4C2F62218FAF1BC0E5FF0@phx.gbl>
References: <DUB108-W51773E4C2F62218FAF1BC0E5FF0@phx.gbl>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-it-generale>
Ciao Eugenio,
On Fri, Mar 01, 2013 at 11:53:17AM +0000, Eugenio Trumpy wrote:
> ho provato con join ma mi si replicano troppe volte le row.Qualcuno ha suggerimenti?
potresti provare con
SELECT *
FROM t1
LEFT JOIN t2 ON t1.key = t2.key
LEFT JOIN t3 ON t1.key = t3.key
ORDER BY t1.key;
che a me dà il seguente output:
key | f1 | f2 | f3 | key | f4 | f5 | key | f6 | f7
-----+----+----+----+-----+-----+-----+-----+----+----
1 | a | b | c | | | | 1 | t | v
2 | d | e | f | 2 | oo | pp | 2 | v | z
2 | d | e | f | 2 | ooo | ppp | 2 | v | z
2 | d | e | f | 2 | o | p | 2 | v | z
3 | g | h | i | 3 | r | s | 3 | j | k
4 | l | m | n | | | | | |
(6 righe)
Saluti,
Dr. Gianni Ciolli - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
gianni.ciolli@2ndquadrant.it | www.2ndquadrant.it
--
Sent via pgsql-it-generale mailing list (pgsql-it-generale@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-it-generale
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-it-generale@postgresql.org
Cc: gianni.ciolli@2ndquadrant.it
Subject: Re: query concatenate
In-Reply-To: <20130301120426.GD3079@756b4.gi.lan>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox