Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 01EDF9FA248 for ; Thu, 14 Dec 2006 08:10:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 70141-03 for ; Thu, 14 Dec 2006 08:10:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mx1.ipf.is (mack.ipf.is [85.197.192.164]) by postgresql.org (Postfix) with ESMTP id CA62E9F9F08 for ; Thu, 14 Dec 2006 08:10:16 -0400 (AST) Received: (qmail 27819 invoked by uid 1010); 14 Dec 2006 12:06:56 +0000 Received: from 88.149.106.19 by mack (envelope-from , uid 1008) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.4/1639. spamassassin: 3.1.4. perlscan: 1.25-st-qms. Clear:RC:1(88.149.106.19):SA:0(-2.4/4.5):. Processed in 2.433874 secs); 14 Dec 2006 12:06:56 -0000 X-Antivirus-HIVE-Mail-From: gnari@hive.is via mack X-Antivirus-HIVE: 1.25-st-qms (Clear:RC:1(88.149.106.19):SA:0(-2.4/4.5):. Processed in 2.433874 secs Process 27809) Received: from dsl-149-106-19.hive.is (HELO ?192.168.1.33?) (88.149.106.19) by mx1.ipf.is with SMTP; 14 Dec 2006 12:06:53 +0000 Subject: Re: join a lot of columns of two tables From: Ragnar To: marchesini@unipg.it Cc: pgsql-sql@postgresql.org In-Reply-To: <1166094060.5978.22.camel@geoivan> References: <1166094060.5978.22.camel@geoivan> Content-Type: text/plain Date: Thu, 14 Dec 2006 12:10:59 +0000 Message-Id: <1166098259.6369.138.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/106 X-Sequence-Number: 27062 On fim, 2006-12-14 at 12:01 +0100, ivan marchesini wrote: > Dear Postgres Users, > I have 2 tables... > each one has a column called ID (primary keys of each table) > the values into each ID column are exactly the same. > > each table has a lot of other columns (around 50 for each table).... > > I would like to create a table containing the ID (only one column > obviously) and all the other columns of both tables... > > a simple equi join for each column is simple but how can I join > completely the two table on the bases of the column ID??? > > probably it is a simple question but I don't know how to solve this very > simple problem quikly... :-( > thanks select * from t1 join t2 USING (id); gnari