Thread: problem in joins

problem in joins

From
"deepak pal"
Date:
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.........

Re: problem in joins

From
Richard Broersma Jr
Date:
>   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.

Re: problem in joins

From
"A. Kretschmer"
Date:
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

Re: problem in joins

From
Ragnar
Date:
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





Re: problem in joins

From
Richard Broersma Jr
Date:
--- deepak pal <deepak.05pal@gmail.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.

http://sqlzoo.net/3b.htm

Regards,

Richard Broersma Jr.