From: | David Eduardo Gomez Noguera <davidgn(at)servidor(dot)unam(dot)mx> |
---|---|
To: | postgres <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: joins? |
Date: | 2002-03-06 17:29:28 |
Message-ID: | 20020306112928.1beed663.davidgn@servidor.unam.mx |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, 6 Mar 2002 11:57:57 -0500
"Gregory Wood" <gregw(at)com-stock(dot)com> wrote:
i do joins on a foreign key.
i.e.
from (table1 left join table2 on table1.id=table2.fk_table1_id) left join table3 on table1.id=table2.fk_table1_id...
do you know if postgres takes any advantage of that? or if there is an easier way to write it?
(i.e. tell it to join on foreign keys constraints)
> Explicit joins allow you to order the joins any way you want. When join
> conditions are in the WHERE clause, you don't have any control over the
> order in which the tables are joined.
>
> Additionally, when you do an explicit join, you can perform other types of
> joins, such as an inner join, outer join, etc.
>
> Personally I prefer doing explicit joins because it makes my SQL more
> readable to me; all the glue that joins the tables together is in the FROM,
> and the WHERE clause just limits the rows that I want returned.
>
> Greg
>
> ----- Original Message -----
> From: "David Eduardo Gomez Noguera" <davidgn(at)servidor(dot)unam(dot)mx>
> To: "postgres" <pgsql-general(at)postgresql(dot)org>
> Sent: Wednesday, March 06, 2002 10:40 AM
> Subject: [GENERAL] joins?
>
>
> > Hello.
> > I am a bit new to databases. just still learning.
> > I havent got it right, but wht is the difference between a joint and a
> where clause?
> > specially "join on ".
> >
> > --
> > ICQ: 15605359 Bicho
> > =^..^=
> > First, they ignore you. Then they laugh at you. Then they fight you. Then
> you win. Mahatma Gandhi.
> > -------------------------------気検体の一
> 致------------------------------------
> > 暑さ寒さも彼岸まで。
> > 恋にししょうなし。恋はしあんの他。
> > アン アン アン とっても大好き
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/users-lounge/docs/faq.html
> >
--
ICQ: 15605359 Bicho
=^..^=
First, they ignore you. Then they laugh at you. Then they fight you. Then you win. Mahatma Gandhi.
-------------------------------気検体の一致------------------------------------
暑さ寒さも彼岸まで。
恋にししょうなし。恋はしあんの他。
アン アン アン とっても大好き
From | Date | Subject | |
---|---|---|---|
Next Message | David Griffiths | 2002-03-06 17:30:39 | Re: Problems with unconstrained join |
Previous Message | Tom Lane | 2002-03-06 17:06:43 | Re: Problems with unconstrained join |