| From: | Ragnar <gnari(at)hive(dot)is> | 
|---|---|
| To: | deepak pal <deepak(dot)05pal(at)gmail(dot)com> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: problem in joins | 
| Date: | 2006-11-20 09:29:52 | 
| Message-ID: | 1164014992.8950.491.camel@localhost.localdomain | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rafal Pietrak | 2006-11-20 09:43:24 | functions: stable/volatile | 
| Previous Message | Richard Huxton | 2006-11-20 08:58:55 | Re: tracking errors in psql |