I must update table, and I can’t use else if in tsql. Is it exists?
Status =
(
CASE
WHEN
(Status in (0))
THEN
0
ELSE IF Status in (1)
THEN
7
ELSE
Status
END
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The CASE WHEN syntax does support multiple conditions:
Since you are comparing the same field for equality in both cases, you can use the shorter notation: