条件始终为true的SQL

时间:2011-12-05 11:57:26

标签: sql

如何在SQL中设置始终为true的where条件???

据我所知:'1 = 1',还有其他方法吗?

1 个答案:

答案 0 :(得分:28)

您是偶然谈论collapse条件,其中分组条件始终为TRUEFALSE

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