• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tip: toggling a boolean database column

#3
[eluser]sophistry[/eluser]
the bitwise operator XOR would work for this too :-)
Code:
UPDATE mytable SET column=1 XOR column WHERE [condition];


Messages In This Thread
Tip: toggling a boolean database column - by El Forum - 06-29-2009, 10:24 AM
Tip: toggling a boolean database column - by El Forum - 06-29-2009, 10:46 AM
Tip: toggling a boolean database column - by El Forum - 07-03-2009, 12:21 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.