Following is an example of nested MySQL Case When or then else End statement.
select CASE When (table.field1 = '01') THEN CASE When (SUBSTRING_INDEX(table.field1, ' ', 1) = 'abc') THEN '01abc' ELSE 'abc' END WHEN (table.field1 = '02') THEN CASE When ((SUBSTRING_INDEX(table.field1, ' ', 1)) = 'def') THEN '02def' ELSE 'def' END When (table.field1 = '03') THEN CASE When ((SUBSTRING_INDEX(table.field1, ' ', 1)) = 'efg') THEN '03efg' ELSE 'efg' END WHEN (table.field1 = '04') THEN CASE When ((SUBSTRING_INDEX(table.field1, ' ', 1)) = 'pqr') THEN '04pqr' ELSE 'pqr' END END from table ;