News: >> blog <new> !

Twitt this! Email this!
Using boolean logic instead of CASE in WHERE clause of query in MS-SQL
Benefits :
  • Faster Performance
  • Improved Code Readability

Examples :
  • Replace "IF A THEN B " with "(NOT A)or B "
  • Replace "IF A THEN B ELSE C " with "((NOT A)or B) AND (A OR C) "

source : SQL WHERE clauses: Avoid CASE, use Boolean logic