var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: SQL WHERE Clause Order
Does SQL Server execute filter conditions in the order given?
"SELECT * FROM table WHERE customerID=268 AND item_description LIKE '%pants%';"
Does SQL Server first filter by customerID and then look for "pants" in the remaining records?
If not, how can I force SQL Server to execute filter conditions in a particular order?
First, it selects * from table, then the where condition applies.
Click CTRL+L to see the execution plan.
Your assumtions are correct.
First it selects all, based on your first parameter value, then it checks the result based on your second value. If using "AND" both params must be valid.. (of topic hehe)
But yes, its in the order you think it is
U can use HINTS like (INDEX = indexname) to force system to look for a desired index. In you case it will be good to have index on CustomerId. Since SQL will not use index in case of LIKE clause starting with a wildcard character
Best of luck