I am trying to use a Case statement to check if one column has a certain value and based on that value set another column equal to a certain value. Any help on how to do this would be greatly appreciated.
Something Like This:
SELECT
td=isnull(a.[Instance_Name],''), '',
td=isnull
(CASE
WHEN a.[Instance_Name] LIKE 'ZZZ%'
THEN 'ZZZ'
ELSE MAX(dbl.[Mnemonic])
END AS dbl.[Mnemonic]), '',
td=isnull(dbl.[Env_Type],''), '',
FROM #FailedCRITs a
INNER JOIN [Util].[DBLIST] dbl ON a.[Instance_Name] = dbl.[Instance_Name]