Home  >  Article  >  Database  >  Does mysql between and contain boundaries?

Does mysql between and contain boundaries?

hzc
hzcOriginal
2020-06-18 12:04:3316899browse

Does mysql between and contain boundaries?Mysql data query statement between and contains boundary values

MySQL You can use between in sql statements to limit the range of a data, for example:

select * from user where userId between 5 and 7;

Query users whose userIds are 5, 6, and 7. The userId range includes boundary values, which is also equivalent to the following query:

select * from user where userId >= 5 and userId 9b4a1e288cc9ada0e7e6dd69d7e2d9e0= and <= to specify the conditions.

In addition, the range of not between does not include boundary values.

Recommended tutorial: "mysql tutorial"

The above is the detailed content of Does mysql between and contain boundaries?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn