SQL BETWEEN 操作符
August 20, 2022
SQL BETWEEN 操作符 # BETWEEN 操作符用于选取介于两个值之间的数据范围内的值。 BETWEEN 操作符选取介于两个值之间的数据范围内的值。这些值可以是数值、文本或者日期。 SQL BETWEEN 语法 # SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2; BETWEEN 操作符实例 # 下面的 SQL 语句选取 id 介于 10 和 20 之间的所有记录: MariaDB [learnsql]> select * from domains where id between 10 and 20; +----+----------+---------------+-----------+-----------+ | ID | ICP | DomainName | RegDate | EndDate | +----+----------+---------------+-----------+-----------+ | 12 | namesilo | blbl.dev | 2020/1/17 | 2023/1/17 | | 13 | namesilo | raspi. ...