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

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

    If you came here searching for WHERE 1, note that WHERE 1 and WHERE 1=1 are identical. WHERE 1 is used rarely because some database systems reject it considering WHERE 1 not really being boolean.

提交回复
热议问题