Link to home
Start Free TrialLog in
Avatar of Jim Horn
Jim HornFlag for United States of America

asked on

Syntax for CASE WHEN with multiple criteria

UPDATE #tmp
SET   Product_Type = CASE plcy.PTYP_ID WHEN 4 OR 8 OR 11 OR 15 OR 16 OR 17) then 'B' else 'A' END

What's the correct syntax for CASE WHEN {multiple values} THEN {something} END?

TIA
-Jim
SOLUTION
Avatar of flavo
flavo
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jim Horn

ASKER

Thanks guys.  I was using the IN, but for some reason not able to get it to work.
>>  16 OR 17) then 'B' els

You had an unclosed paren in the original.
Glad to be of assistance. May all your days get brighter and brighter.