In MS SQL , IF …ELSE is a type of Conditional statement . Any T- SQL statement can be executed conditionally using IF … ELSE. If the condition evaluates to True, then T- SQL statements followed by IF keyword will be executed. Simply so, how do I do an if statement in SQL? Each IF statement has a condition. If the condition evaluates to TRUE then the statement block in the IF clause is executed. If the condition is FALSE , then the code block in the ELSE clause is executed. Subsequently, question is, can we use CASE statement in where clause in SQL? According to Ms SQL Docs, a CASE statement can be used throughout the SELECT statement . CASE can be used in any statement or clause that allows a valid expression . For example, you can use CASE in statements such as SELECT, UPDATE, DELETE and SET, and in clauses such as select_list, IN, WHERE, ORDER BY, and HAVING. Likewise, what is SQL IIF? IIF is a shorthand way for writing a CASE expression. It ...