Home > Article > Backend Development > Talk about the between_PHP tutorial on sql query
Author: Ah Liang
Published in ASP Zone, 2000-11-25 21:42
Example 1: Find the student number and age of students between 20 and 22 years old (including 20 and 22)
select number,age
from s
where age between 20 and 22
Example 2: Find the student number and age of students who are not between 20 and 22 years old
select number,age
from s
where age not between 20 and 22
Note: between is followed by a low value, and is followed by a high value!