Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
指定包含的范围,将搜索该范围的上限值、下限值以及介于这两个值之间的值。
expression [ NOT ] BETWEEN start-expression AND end-expression
BETWEEN 条件的值可以是 TRUE、FALSE 或 UNKNOWN。无 NOT 关键字时,如果 expression 介于 start-expression 和 end-expression 之间,则条件的值为 TRUE。关键字 NOT 使条件的含义相反,但保留 UNKNOWN 不变。
BETWEEN 条件相当于两个不等式的组合:
[ NOT ] ( expression >= start-expression AND expression <= end-expression )
列出价格低于 $10 或高于 $15 的所有产品。
SELECT Name, UnitPrice FROM Products WHERE UnitPrice NOT BETWEEN 10 AND 15;