Is there a way to make a CASE statement with an IN clause?
SELECT
CASE c.Number
IN ('1121231','31242323') THEN 1
IN ('234523','2342423') THEN 2
END AS Test
FROM tblClient c
See Question&Answers more detail:osIs there a way to make a CASE statement with an IN clause?
SELECT
CASE c.Number
IN ('1121231','31242323') THEN 1
IN ('234523','2342423') THEN 2
END AS Test
FROM tblClient c
See Question&Answers more detail:osYes. You need to use the "Searched" form rather than the "Simple" form of the CASE
expression
SELECT CASE
WHEN c.Number IN ( '1121231', '31242323' ) THEN 1
WHEN c.Number IN ( '234523', '2342423' ) THEN 2
END AS Test
FROM tblClient c