Site icon Database Tutorials

Between Operator in SQL Server(TSQL)

 

When reading data from the database with Between Operator, we can specify a range for the data we filter in WHERE Clause. Let’s make an example for a better understanding of the subject.

Example:

First, let’s create a table as below and add a few records.

List the people aged 30 to 40 years old:

List the people whose names are between N and P:

List the people whose names are not between N and P:

Exit mobile version