dbTalk Databases Forums  

difference between join syntax

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss difference between join syntax in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Natan
 
Posts: n/a

Default difference between join syntax - 08-29-2004 , 07:03 PM






Can anyone tell me if there is any difference between these two commands:

select * from table1, table2 where table1.id = table2.id
and
select * from table1 inner join table 2 on table1.id = table2.id

I checked the query plan for both and they appear exactly the same. But
in this case, i am working with only two tables in a very simple
join.... What i would like to know is: in a production environment with
lots of joins and where clauses, does it make any difference to write in
one form or in the other, or the joins are like shortcuts to the first form?


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: difference between join syntax - 08-29-2004 , 07:54 PM






Natan <nvivo (AT) mandic (DOT) com.br> writes:
Quote:
Can anyone tell me if there is any difference between these two commands:
select * from table1, table2 where table1.id = table2.id
and
select * from table1 inner join table 2 on table1.id = table2.id
Nope.

Quote:
I checked the query plan for both and they appear exactly the same. But
in this case, i am working with only two tables in a very simple
join.... What i would like to know is: in a production environment with
lots of joins and where clauses, does it make any difference to write in
one form or in the other, or the joins are like shortcuts to the first form?
With more than two tables, it *can* make a difference. If using 7.4,
see
http://www.postgresql.org/docs/7.4/s...cit-joins.html
Earlier versions were a bit different --- make the obvious change in
the URL to see the corresponding docs for your version.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.