xhen

$sql="update article set comment=comment^1 where a_id=2";

这条语句你会发现当你更新comment字段时为1,再次更新时为0;

comment=comment^1,这是一个位运算,comment的默认值为0,当进行位运算它会变为1,再次位运算会变为0;一直反复;

 

分类:

技术点:

相关文章:

  • 2021-11-07
  • 2021-09-24
  • 2021-11-12
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-08-13
猜你喜欢
  • 2022-12-23
  • 2023-02-08
  • 2022-02-13
  • 2021-12-08
  • 2022-12-23
  • 2021-11-07
相关资源
相似解决方案