IF condition is satisfied and the Boolean expression returnsTRUE, it will executed IF Block Sql statement.
IF condtion is not satisfied and the Boolean expression returns FALSE, it will executed ELSE Block Sql Statement query.
Syntax for IF...ELSEIF ( Boolean_expression )
BEGIN
Sql Statement Block
END
ELSE
BEGIN
Sql Statement Block
END
Example
IF (3<2) SELECT 'Correct' ELSE SELECT 'Wrong'
No comments:
Write comments