I have a users table in my mysql database with columns like id, age and gender. I have inserted around 500 records into it.
Now i need to interchange the gender for the records, i.e., replace male with female and female with male.
I thought to do it this way:
update users set gender='female' where gender='male';
update users set gender='male' where gender='female';
But as you can see, as soon as i run the first query, all the records will be updated with the gender set to 'female'.
How can i modify the query or shall i go another way?