How to use the instructions orin the whensection case?
DECLARE @TestVal INT
SET @TestVal = 1
SELECT
CASE @TestVal
WHEN 1 THEN 'First'
WHEN 2 THEN 'First'
WHEN 3 THEN 'Third'
ELSE 'Other'
END
instead of the top two lines, I want to use something like this:
when 1 or 2 then 'First'
source
share