UPDATE table_name SET feild1 = CASE WHEN feild1 = '0' THEN 'xxx0' WHEN feild1 = '1' THEN 'xxx1' WHEN xxx_type = '2' THEN 'xxx2' END, feild2 = CASE WHEN feild2 = '0' THEN 'xxx0' WHEN feild2 = '1' THEN 'xxx1' WHEN xxx_type = '2' THEN 'xxx2' END, WHERE condition1 = xxx