I want to use like in case statement and search string from a particular colmun if any part of that string contains 'Moderate to severe aortic stenosis' THEN instead of full string I want to display 'Moderate to Severe' if any part of that string contains 'Severe aortic stenosis with' THEN instead of full string I want to display 'Severe' if that string contains 'moderate aortic stenosis present' THEN instead of full string I want to display 'Moderate'
Below is my query not working some systax error
SELECT (CASE a.Column when LIKE '%Moderate to severe aortic stenosis%' THEN 'Moderate to Severe'
when LIKE '%Severe aortic stenosis with%' THEN 'Severe'
when LIKE '%moderate aortic stenosis present%' THEN 'Moderate' else ' ' end)
from MyTable a
Please help