[thelist] MySQL toggle

Mark Kennedy mark at eurogamer.net
Mon Feb 16 12:58:42 CST 2004


UPDATE table_name SET field_name = 1 - field_name

On Mon, 16 Feb 2004, Tony Crockford wrote:

>Hi
>
>long day - brain fading fast
>
>is there such athing as a mysql query that will toggle a tinyint value?
>
>i.e if field is 1 update to 0 if field is 0 update to 1.
>
>I've tried googling and looking through the documentation, but I'm 
>obviously not searching for the correct terminology.
>
>TIA
>
>Tony
>
>-- 
>listening to: "if you don't know me by now" by David Brent
>
>http://www.xebit.net/
>-- 
>* * Please support the community that supports you.  * *
>http://evolt.org/help_support_evolt/
>
>For unsubscribe and other options, including the Tip Harvester 
>and archives of thelist go to: http://lists.evolt.org 
>Workers of the Web, evolt ! 
>

 



More information about the thelist mailing list