Database table update using single mysql query I need a single update query to update the gender in a table - swap 'F' with 'M' and 'M' with 'F'.
Many ways to do this.

One way is using case when ... (assuming no NULLs or other gender values):

update yourtable set gender = (case when gender ='F' then 'M' else 'F' end);