Go Back   Cloud Computing > Support > MySQL Issues.
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-15-11, 12:53
BOD Member
 
Join Date: Jul 2011
Posts: 37
Default Where Or Join

Hello

What is a logical relationship or difference between WHERE and JOIN statements in terms of performance and desired results:

Quote:
select user.first_name, user.last_name, orders.order no from user inner join orders user.c_id=user.c_id
and

Quote:
select user.first_name, user.last_name, orders.order no from user, orders where user.c_id=orders.c_id
Reply With Quote
  #2 (permalink)  
Old 07-15-11, 12:55
BOD Member
 
Join Date: Jul 2011
Posts: 68
Default

In my opinion, there is no difference between both even in terms of performance and results, however, one of those method is considered as the best practice while the other might be considered as deprecated.
Reply With Quote
  #3 (permalink)  
Old 12-09-11, 11:15
BOD Member
 
Join Date: Dec 2011
Posts: 6
Default Where Or Join

Using JOIN makes the code easier to read, since it's self-explanatory.

In speed, there's no difference (I have just tested it), and the execution plan is the same....


Using the JOIN syntax allows you to more easily comment out the join as its all included on one line. This can be useful if you are debugging a complex query
Reply With Quote
  #4 (permalink)  
Old 12-09-11, 11:16
BOD Member
 
Join Date: Dec 2011
Posts: 6
Default Where Or Join

Using JOIN makes the code easier to read, since it's self-explanatory.

In speed, there's no difference (I have just tested it), and the execution plan is the same....


Using the JOIN syntax allows you to more easily comment out the join as its all included on one line. This can be useful if you are debugging a complex query


Thanks
Name Abhishek Pathak
CoreItDevelopers
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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 00:51.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.