In a Transact SQL Statement which is the fastest way of extracting the data using
Exists & In in a subquery
With Explanation Please.
I am not sure what you mean by extracting data using sub-query. In any case, it depends on the query plan. Most cases you will see the same execution plan for EXISTS and IN. You should write SQL code that is intuitive for the problem rather that worrying about the construct. For example, if you want to retrieve rows based on presence/absence of a row(s) in another table then use EXISTS since it is more natural to read. You can also compare the plans between the two queries and decide based on the performance.|||Thanks for responding.
I will compare the plans.
But I would like to know if you have any experience on this. Or the experts users has any recomendations for this - Exists/In
Books On line recommends Exists
Thanks
sqlsql
No comments:
Post a Comment