Why would someone use WHERE 1=1 AND in a SQL clause?

后端 未结 19 1994
甜味超标
甜味超标 2020-11-22 07:08

Why would someone use WHERE 1=1 AND in a SQL clause (Either SQL obtained through concatenated strings, either view definition)

I\'ve

相关标签:
19条回答
  • 2020-11-22 07:51

    Seems like a lazy way to always know that your WHERE clause is already defined and allow you to keep adding conditions without having to check if it is the first one.

    0 讨论(0)
提交回复
热议问题