update salary set sex=IF(sex='f','m','f');
or
update salary set sex = char(ascii('m') + ascii('f') - ascii(sex));