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.

Gavinplato 01-28-2024 04:38 AM

Have you encountered any specific challenges or considerations when toggling MySQL TinyInt columns using this query, especially regarding the default value of the 'field' column?


All times are GMT -4. The time now is 07:17 PM.

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