Home » SQL & PL/SQL » SQL & PL/SQL » Where vs join (faster query )
Where vs join (faster query ) [message #388583] Wed, 25 February 2009 08:52 Go to next message
Smash
Messages: 18
Registered: August 2008
Junior Member
Hello !
We have two simple tables

http://img26.imageshack.us/img26/3647/10391726.jpg

select s.name.s.surname,p.points from students s 
join points p on s.idstudent=p.idstudent


vs
select s.name.s.surname,p.points from students s , points p 
where s.idstudent=p.idstudent


Is there any performance difference between these two queries ? If yes, which gonna be faster and why ?

cheers
Re: Where vs join (faster query ) [message #388585 is a reply to message #388583] Wed, 25 February 2009 08:53 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is 2 ways to express the same thing.
Just a syntax difference, the rest is the same.

Regards
Michel
Re: Where vs join (faster query ) [message #388606 is a reply to message #388583] Wed, 25 February 2009 11:39 Go to previous messageGo to next message
Smash
Messages: 18
Registered: August 2008
Junior Member
And if there gonna by more connected tables , still the same ?

[Updated on: Wed, 25 February 2009 11:39]

Report message to a moderator

Re: Where vs join (faster query ) [message #388612 is a reply to message #388606] Wed, 25 February 2009 12:14 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Yes
ANSI join syntax and Oracles join syntax get parsed the same.
Re: Where vs join (faster query ) [message #388614 is a reply to message #388606] Wed, 25 February 2009 12:17 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Still the same.

Regards
Michel
Re: Where vs join (faster query ) [message #388969 is a reply to message #388583] Thu, 26 February 2009 16:59 Go to previous message
gintsp
Messages: 118
Registered: February 2007
Senior Member
For inner joins it is irrelevant whether you post condition as join condition or where predicate. However for outer joins it is important because functionally result is different.
See more SQL join types.
Previous Topic: sql_id
Next Topic: rollback procedure
Goto Forum:
  


Current Time: Sat Dec 10 18:14:46 CST 2016

Total time taken to generate the page: 0.08027 seconds