MySQL SQLLesson 26Free preview
MySQL BETWEEN
This lesson is part of MySQL · All levels
Summary
The Between operator checks whether a value is within a certain range, including both of its limits. BETWEEN is commonly used on the range of numbers and dates, e.g. the price of BETWEEN 10000 AND 50000 or the date of BETWEEN '2024-01-01' AND '2024-06-30'. For non-inclusive ranges, write comparisons > and < manually, and use NOT BETWEEN to reverse.
Key points
- BETWEEN a AND b includes values a and b (inclusive boundary)
- Can be used for numerical type, date, or time
- Not Between Taking Scores Out of Range
- Write the bottom line before the top line; the reverse sequence will produce a blank result.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.