Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Can I use IN as part of a case statement?

$
0
0

Can I use an IN statement as part of a case, something like this

SELECT COLB,
CASE 
WHEN mt.testshoe IN (34,55,88) OR o.TestType IN (201) THEN 'ABC'
WHEN (ColA IS NULL) THEN 'DEF'
END  AS testval


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>