Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 7FE469FA162 for ; Thu, 14 Dec 2006 07:09:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 78356-01 for ; Thu, 14 Dec 2006 07:09:11 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by postgresql.org (Postfix) with ESMTP id 2373D9F9F08 for ; Thu, 14 Dec 2006 07:09:14 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so455581ugf for ; Thu, 14 Dec 2006 03:09:13 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PmWkfzzPhgZHKhQDUjoe8qxYO6ElI96uvpfhbABvzjDC25mWPzeQhCbetyKV8SLlhEd+Svyho3iVfKdx5NHU0lWhV69B0BNieq4gMLqnS3P9M0lnw3Gz60S8XYzZybAzSqjRc8srXxFzNn1KPBkY8Lzh3EzkCYMQf+FzLxMwhbY= Received: by 10.78.181.13 with SMTP id d13mr617513huf.1166094553387; Thu, 14 Dec 2006 03:09:13 -0800 (PST) Received: by 10.78.107.14 with HTTP; Thu, 14 Dec 2006 03:09:13 -0800 (PST) Message-ID: Date: Thu, 14 Dec 2006 11:09:13 +0000 From: "Peter Childs" Subject: Re: join a lot of columns of two tables Cc: pgsql-sql@postgresql.org In-Reply-To: <1166094060.5978.22.camel@geoivan> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1166094060.5978.22.camel@geoivan> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/105 X-Sequence-Number: 27061 On 14/12/06, 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 > > Ivan > select * from t1 full join t2 on (t1.id=t2.id); you'll end up with the id column from both tables if you don't want that you are going to need to list all the column names. Peter.