Inclusiveness of SQL – BETWEEN operator

Both parameters passed to the BETWEEN operator in SQL are inclusive to it.

e.g. SELECT * FROM Employees WHERE Age BETWEEN 20 and 30;

The above SQL returns all the records from the table – Employees where the age is >= 20 and <= 30. Here the employee records whose age is either 20 or 30 are also retrieved. See the below.

BETWEEN Operator in SQL
BETWEEN Operator in SQL

Happy time until my next blog post.. 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up ↑

%d bloggers like this: