Operator in SQL

BETWEEN Operator in SQL

When we use between operator then it compare all the records which match with our given range after BETWEEN operator.

For example if want to select those record form table below where order-amount is from 20000 to 50000

then we use following statement:

SELECT  *  FROM client_info WHERE order_amount between 20000 and 50000 ;

Actual Table

client_ID city order_amount
A001 Karachi 50000
A002 Lahore 20000
B001 Karachi 30000
B002 Islamabad 10000
B004 Karachi 15000

The above statement display the following record.

Selected record with BETWEEN Operator

client_ID city order_amount
A001 Karachi 50000
A002 Lahore 20000
B001 Karachi 30000