select * from a where 1=1 (and a.id is null or a.id = 0) 执行出错
select * from a where 1=1 and (a.id is null or a.id = 0) 执行正常

说明1:使用 or 关键字最好要用括号把条件括起来
说明2:前置括号放置 and 关键字之后,一定不要把 and 关键字括起来

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2021-04-02
  • 2021-09-04
  • 2021-12-08
  • 2022-01-17
猜你喜欢
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2021-12-27
  • 2021-08-21
相关资源
相似解决方案