Home  >  Article  >  Database  >  Does the between query in SQL include boundaries?

Does the between query in SQL include boundaries?

青灯夜游
青灯夜游Original
2019-05-11 16:25:569348browse

In sql, the between operator is used to query a certain range of values. These values ​​can be numbers, text or dates. So does the range that the between operator can query include boundaries? The following article will introduce it to you, I hope it will be helpful to you.

Does the between query in SQL include boundaries?

The following is an example to illustrate:

I have a table with only 4 rows of data:

Does the between query in SQL include boundaries?

Use between query:

Does the between query in SQL include boundaries?

It can be seen that using between query includes the front and rear boundary values.

If you want to display people outside the range, you need to use it with the NOT operator and use not between to query, for example:

Does the between query in SQL include boundaries?

The above is the detailed content of Does the between query in SQL include 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