如何在SQL中设置始终为true的where条件???
据我所知:'1 = 1',还有其他方法吗?
答案 0 :(得分:28)
您是偶然谈论collapse
条件,其中分组条件始终为TRUE
或FALSE
?
WHERE TRUE
WHERE 1
WHERE <string value> = <the same string value>
WHERE <numeric value> = <the same numeric value>
WHERE <hardcoded formula> = <the same hardcoded formula or one that produces the same value>
WHERE NULL IS NULL