How's this for the a super simple way to flip a bit field from 1 to 0 and back:
UPDATE myTable SET myBitField = coalesce(myBitField,0) ^ 1 WHERE myPrimaryKey = 'uniqueIDHere'
I'm in love.
Written by Jamie M. |
How's this for the a super simple way to flip a bit field from 1 to 0 and back:
UPDATE myTable SET myBitField = coalesce(myBitField,0) ^ 1 WHERE myPrimaryKey = 'uniqueIDHere'
I'm in love.