Lampwrights Forum

Lampwrights Forum (http://www.lampwrights.com/index.php)
-   MySQL (http://www.lampwrights.com/forumdisplay.php?f=3)
-   -   Toggling a MySQL TinyInt Column (http://www.lampwrights.com/showthread.php?t=73)

Jeff 02-23-2011 11:10 AM

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.


All times are GMT -4. The time now is 05:18 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2020, vBulletin Solutions, Inc.