I have this where clause where I'm passing in a status code and if it's not passed (therefore NULL), status_code <> 10 (or equal to 9 or 11 or 12); if it is passed then i want to search for status_code = 10.
Help pls!
WHERE status_code
IN
CASE @status_code WHEN NULL THEN (9,11,12)
ELSE (10)
END
Btw, I already have this where clause inside an IF statement.