SET LASTNAME =
WHEN (LASTNAME = 'AAA') THEN 'BBB'
WHEN (LASTNAME = 'CCC') THEN 'DDD'
WHEN (LASTNAME = 'EEE') THEN 'FFF'
The statement work for the purpose but the else condition scan through every record in the table. Is there any way I can leave the unaffected rows as they are?