MySQL Two solution
Using if() similar to ternary operator  if(condition,if cond. is true return this, else return this)\n\nupdate salary set sex = IF (sex = "m", "f", "m")\n\n\n#u
#Using if() similar to ternary operator  if(condition,if cond. is true return this, else return this)\n```\nupdate salary set sex = IF (sex = "m", "f", "m")\n```\n\n#using case..when\n```\nupdate salary\nset sex=case\n            when sex=\'f\' then \'m\'\n            when sex=\'m\' then \'f\'\n        end;\n```
['MySQL']