something about mysql

  1. select查询时使用 where 1=1
    • 为了在条件查询时可以保证sql可以运行
    • 不用条件查询的时候为什么也用?
      • 参考Stack Overflow——“You’re avoiding repetitive code and unnecessary condition checks. ”
      • 其他可能参考此处stackoverflow
  2. mysql查询时使用 where 0=1
    • 只会返回表结构而不会返回任何数据 参考