Lists: | pgsql-general |
---|
From: | "deepak pal" <deepak(dot)05pal(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | problem in joins |
Date: | 2006-11-20 05:53:37 |
Message-ID: | 5d9b30f0611192153p1208f76ds12d4fa2085aee08b@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
hello all..
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.........
From: | Richard Broersma Jr <rabroersma(at)yahoo(dot)com> |
---|---|
To: | deepak pal <deepak(dot)05pal(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: problem in joins |
Date: | 2006-11-20 06:51:50 |
Message-ID: | 343916.47780.qm@web31806.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
> i am facing problem in joining three table...there are two columns common
> in two table..is it necessary to use both these two column..in where
> clauses.........
If you provide table definitions, it would be easier to say. But in the mean time you can read up
on joining table from the following link:
http://www.postgresql.org/docs/8.2/interactive/queries-table-expressions.html#QUERIES-JOIN
Regards,
Richard Broersma Jr.
From: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: problem in joins |
Date: | 2006-11-20 06:55:29 |
Message-ID: | 20061120065529.GB27960@a-kretschmer.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
am Mon, dem 20.11.2006, um 11:23:37 +0530 mailte deepak pal folgendes:
> hello all..
> 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.........
I think, you are searching for aliases for this two columns, but your
description of the problem is very sketchy.
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
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: | Raw Message | Whole Thread | Download mbox | Resend email |
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: | Richard Broersma Jr <rabroersma(at)yahoo(dot)com> |
---|---|
To: | deepak pal <deepak(dot)05pal(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: problem in joins |
Date: | 2006-11-21 03:34:37 |
Message-ID: | 888979.30327.qm@web31802.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
--- deepak pal <deepak(dot)05pal(at)gmail(dot)com> wrote:
> hello all..
> 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.........
You can practice joins using this link.
Regards,
Richard Broersma Jr.