Hi
Is it possible to write something like
Case when a in (value1,value2) then b else a end
Hi
Is it possible to write something like
Case when a in (value1,value2) then b else a end
YES.
try it out with a simple query:
SELECT CASE WHEN 2 in (1,2) then 'B' ELSE 'A' END
OUTPUT:
----
B
(1 row(s) affected)
then:
SELECT CASE WHEN 3 in (1,2) then 'B' ELSE 'A' END
OUTPUT:
----
A
(1 row(s) affected)