Although CASE statements are more readable, BOOLEAN statements will be evaluated faster.
Further Reading -
- Kevin Attard - Conditional Filtering: Using conditions in T-SQL WHERE clauses
- Jeff Smith - SQL WHERE clauses: Avoid CASE, use Boolean logic
- Jeff Smith - Optimizing Conditional WHERE Clauses: Avoiding ORs and CASE Expressions
- Code Project - Implementing Dynamic WHERE-Clause in Static SQL
- Split a string to a table using T-SQL
No comments:
Post a Comment