I have a column named status in a table which is of enum type and can have 2 values either 1 or 0. I want to write a query which will automatically check the current value of Enum and change to the other value.
For example, I have rows in table:
id | name | status
-----+---------+---------
1 | Abc | 0
-----+---------+---------
2 | xyz | 1
Now I want to write a mysql query where I pass the id of row to update and I will automatically check the current status and change it to the other. For example, if I pass id=1 it will automatically check the current value of status column and change it to 1. Similarly, if I pass id=2 it checks the status value of row 2 and changes it to 0.