Here's my preferable way to do if else statements in T-SQL. The syntax is pretty simple.
select
case when conditional
then 'true case'
else 'false case'
end
as conditionalValue
Of course the comparisson opporators are <, =, <=, >, <>, >=, IS NULL, and IS NOT NULL.
Enjoy..
Wednesday, February 28, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment