Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TdLMA-0007ch-9O for pgsql-sql@arkaria.postgresql.org; Tue, 27 Nov 2012 13:37:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TdLM9-00079X-1N for pgsql-sql@arkaria.postgresql.org; Tue, 27 Nov 2012 13:37:45 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TdIAt-0003yr-DT for pgsql-sql@postgresql.org; Tue, 27 Nov 2012 10:13:55 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TdIAr-0006iR-SO for pgsql-sql@postgresql.org; Tue, 27 Nov 2012 10:13:55 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TdIAp-0005U8-U3 for pgsql-sql@postgresql.org; Tue, 27 Nov 2012 02:13:51 -0800 Date: Tue, 27 Nov 2012 02:13:51 -0800 (PST) From: ssylla To: pgsql-sql@postgresql.org Message-ID: <1354011231922-5733696.post@n5.nabble.com> Subject: select on many-to-many relationship MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Dear list, assuming I have the following n:n relationship: t1: id_project 1 2 t2: id_product 1 2 intermediary table: t3 id_project|id_product 1|1 1|2 2|1 How can I create an output like this: id_project|id_product1|id_product2 1|1|2 2|1|NULL -- View this message in context: http://postgresql.1045698.n5.nabble.com/select-on-many-to-many-relationship-tp5733696.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql