MySQL boolean - flipping the value? MySQL boolean - flipping the value? mysql mysql

MySQL boolean - flipping the value?


Why not simply use:

UPDATE the_table   SET boolean_field = NOT boolean_fieldWHERE ...

Makes your intention a lot easier to read


You can also use field = 1 - field or field = ! field