Thread
:
Toggling a MySQL TinyInt Column
View Single Post
02-23-2011, 11:10 AM
#
1
Jeff
Administrator
Join Date: Jul 2010
Posts: 402
Rep Power:
10
Toggling a MySQL TinyInt Column
This query:
Code:
UPDATE table set field= 1 - field
Will toggle a tinyint (boolean) column in MySQL. Note, that field should have a default value of either 0 or 1 but not NULL.
Reply With Quote
Jeff
View Public Profile
Visit Jeff's homepage!
Find More Posts by Jeff