problem in joins

Started by deepak palover 19 years ago5 messagesgeneral
Jump to latest
#1deepak pal
deepak.05pal@gmail.com

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.........

#2Richard Broersma Jr
rabroersma@yahoo.com
In reply to: deepak pal (#1)
Re: problem in joins

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.

#3A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: deepak pal (#1)
Re: problem in joins

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

#4Ragnar
gnari@hive.is
In reply to: deepak pal (#1)
Re: problem in joins

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

#5Richard Broersma Jr
rabroersma@yahoo.com
In reply to: deepak pal (#1)
Re: problem in joins
--- 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.