marklarah Posted April 15, 2008 Share Posted April 15, 2008 Is there anyway through a mysql update to switch a Bool field to the opposite without having to do a select first? Quote Link to comment Share on other sites More sharing options...
Barand Posted April 15, 2008 Share Posted April 15, 2008 SET mybool = IF(mybool=1, 0, 1) SET mybool = IF(mybool='Y', 'N', 'Y') or whatever values you are switching between Quote Link to comment Share on other sites More sharing options...
marklarah Posted April 16, 2008 Author Share Posted April 16, 2008 *slaps head* forgot about if.... *slaps head repeatedly* *hangs head in shame and sulks away* </third person> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.