Did you mean something like this (which is what djj55 was alluding to, if I am not mistaken)SELECT COALESCE(l.TargetTerm,'UNDEFINED') AS CompanyName, CompanyId, TermsofUseFROM Customer c LEFT JOIN #Lookup l ON l.SourceTerm = RTRIM(c.Source);
The lookup table would be like this:CREATE TABLE #Lookup(SourceTerm VARCHAR(32), TargetTerm VARCHAR(32));INSERT INTO #Lookup ( SourceTerm, TargetTerm )VALUES ('CREDITNEW','CREDIT'), ('CREDITOLD' , 'CREDIT'), ('TOC' , 'CREDIT'), 'DEBIT' , 'UC DEBIT' ('DEBITOLD' , 'DEBIT' ), ('DEBITNEW' , 'DEBIT' ), ('TLC' , 'DEBIT');