There is IF(expr1,expr2,expr3) in my sql.
How to accomplish it in MS SQL?
You can use a CASE expression:
CASE WHEN expr1 THEN expr2 ELSE expr3 END
By the way, this syntax isn't SQL Server specific - it also works in MySQL and most other databases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With