I have few questions on SQL..
How to analyze the performance of a query? Any software, inbuilt features of MSSQL server 2005/2008?
What shou
I guess the join gives more free to the engine for choice the best query plan. In your exactly case, probably have all solutions similar performances.
SELECT enquiry_courses.*
FROM enquiry_courses
INNER JOIN enquiries ON enquiries.enquiry_id=enquiry_courses
AND session_id = '4cd3420a16dbd61c6af58f6199ac00f1'
MSSQL generally comes with a built in gui tool called Query Analyser which describes how the query will be executed.
For 2) you could rewrite as:
SELECT *
FROM enquiry_courses ec
WHERE EXISTS (select 1 FROM enquiries e
WHERE e.enquiry_id = ec.enquiry_id
and e.session_id ='4cd3420a16dbd61c6af58f6199ac00f1' )
but I can't believe it would make any performance difference in a modern RDBMS.