Sunday , June 16 2024

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.


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:


About dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *