BETWEEN

BETWEEN, NOT BETWEEN, IN and NOT IN Operators in SQL

 

 

 

In the previous post    Create Table Insert Data Into Table and Select Data in SQL, you have learnt how to create a table, insert data into it and
select rows and columns from table. In this post, you will learn how to use BETEEN, NOT BETWEEN, IN and NOT IN operators in SQL.

1- BETWEEN Operator-

 

BETWEEN operator is used to select rows based on a given range.

You can see example, in which first I have selected all columns and all rows. Second, I have selected marks colum and range is between 64 and 71.
Further, you can see the result.

BETWEEN

2- NOT BETWEEN Operator-

 

NOT BETWEEN operator gives just opposite result of BETWEEN command, see the result below.

NOT BETWEEN

 

3- IN Operator-

Using IN operator you can provide list of selected values from a column, see the result below.

 

 IN-OPERATOR-SQL

4- NOT IN Operator-

 

NOT IN operator will give just opposite result as you see using IN operator.

See the result below.

 

NOT-IN-SQL

Leave a Comment

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

©Postnetwork-All rights reserved.