Re: join a lot of columns of two tables

From: Ragnar <gnari(at)hive(dot)is>
To: marchesini(at)unipg(dot)it
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: join a lot of columns of two tables
Date: 2006-12-14 12:10:59
Message-ID: 1166098259.6369.138.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ashish Ahlawat 2006-12-14 13:10:53 Re: join and sort on 'best match'
Previous Message Peter Childs 2006-12-14 11:09:13 Re: join a lot of columns of two tables