Re: problem in joins - Mailing list pgsql-general

From Ragnar
Subject Re: problem in joins
Date
Msg-id 1164014992.8950.491.camel@localhost.localdomain
Whole thread Raw
In response to problem in joins  ("deepak pal" <deepak.05pal@gmail.com>)
List pgsql-general
On mán, 2006-11-20 at 11:23 +0530, deepak pal wrote:
>   i am facing problem in joining three table...there are two columns
> comman in two table..is it nessary to use both these two column..in
> where caluses.........

as a rule, yes.

create table t1 (a1 int ,b1 int, c1 int);
create table t2 (a2 int ,b2 int, d2 int);

if first 2 columns are common, you would:
  select * from t1 JOIN t2 ON ((a1=a2) and (b1=b2));

not sure what your problem with third table is.

if this does not answer your question, please
provide us with an example of what you mean.

gnari





pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: tracking errors in psql
Next
From: Rafal Pietrak
Date:
Subject: functions: stable/volatile