var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Subquery or Inner Join?
When do you want to use a subquery, ie:
SELECT SUM(Sales) FROM Store_Information
WHERE Store_name IN
(SELECT store_name FROM Geography
WHERE region_name = 'West')
when do you want to use a INNER JOIN?
Last edited by smalvarez; 09-17-10 at 22:22.
there are some cases where the subquery is not as efficient as a join(typically when it is a correlated subquery)
however, i think this is a personal preference, and i think that the join is a lot easier to understand
ON Store_Information.Store_name = Geography.store_name
WHERE Geography.region_name = 'West'
Subquery or inner jion??
Though it depends on your wish,, one of the thing u should check is the execution plan for each type such as sub query or inner join.... Both type may may have different cpu cost or I/O Cost