Re: JOINS...

From: Dani Oderbolz <oderbolz(at)ecologic(dot)de>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: JOINS...
Date: 2003-05-09 08:29:51
Message-ID: 3EBB66FF.6030006@ecologic.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi novice,

>Whats the purpose of joins ?? is it the same as selecting from mulitple tables ?
>
>
In a Relational Database liek Postgresql, you try the store data which
as few redundancy as possible.
The result is that you store the data in many tables - eg. persons and
adresses will be separate
(this process is called Normalisation).
Now, to put the corresponding data together again, you need a join
between the tables that belong together.
In order to work, you need at least (numberOfTables -1) Join-Conditions,
for exaple

SELECT
person.name,
address.line1
FROM
person,
address
WHERE
' Here comes the Join Condition
address.person_id = person.person_id

If you do not specify the Join Condition, you will get all
possible combinations of persons and addresses,
the so called cartesian Product of the 2 tables.

Cheers, Dani

In response to

  • JOINS... at 2003-05-09 04:04:31 from psql novice

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2003-05-09 15:27:04 Re: using pl/pgsql
Previous Message psql novice 2003-05-09 04:04:31 JOINS...