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

后端 未结 19 2341
甜味超标
甜味超标 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:49

    1 = 1 expression is commonly used in generated sql code. This expression can simplify sql generating code reducing number of conditional statements.

提交回复
热议问题