0

I know you can do a 1 to 1 relationship in a case statement like such

Select case userID when '12345' Then '12' Else userID End from userInformation

and I don't think you can add 2 criteria in here, but is it possible (if not how could i add a 2nd criteria) to say

Select case userID when '12345' And status is 'Active' Then '12' Else userID End from userInformation

1 Answers1

2

Use a slightly different syntax:

 Select case WHEN userID = '12345' And status = 'Active' Then '12' Else userID End 
 from userInformation
Hogan
  • 69,564
  • 10
  • 76
  • 117