Loading...   

  • Created By Uleat On: 05:21 PM December 27, 2015
  • Link

-- (1 << 21) = 2097152
-- (1 << 22) = 4194304
-- (3 << 21) = 6291456
UPDATE `items` SET `slots` = (`slots` ^ 6291456) WHERE (`slots` & 6291456) in (2097152, 4194304);

-- Verify counts before and after
SELECT '00' `bits`, COUNT(*) `count` FROM `items` WHERE (`slots` & 6291456) = 0 UNION
SELECT '01' `bits`, COUNT(*) `count` FROM `items` WHERE (`slots` & 6291456) = 2097152 UNION
SELECT '10' `bits`, COUNT(*) `count` FROM `items` WHERE (`slots` & 6291456) = 4194304 UNION
SELECT '11' `bits`, COUNT(*) `count` FROM `items` WHERE (`slots` & 6291456) = 6291456;

Raw Paste Data