I need a case statement that allows partial matches. I get a syntax error, but am wondering if anything similar to this is possible. If not, my secondary solution is to re-write as a cursor…
Example:
SELECT CASE ColumnName
WHEN 'value1' THEN 'answer1'
WHEN 'value2' THEN 'answer2'
WHEN LIKE '%TEST%' THEN 'answer3'
END AS Answer
FROM TableName
try this
example you can run