把某字段第10位设置为1

update tests set uid = uid|(1 << 10) where id=1;

把某个字段第10位设置为0

update tests set uid = uid&~(1 << 10) where id=1;

Comments are closed.

Post Navigation