Types of SQL Operators
SQL Arithmetic Operators
- ADD
- Subtract
- Multiple
- Divide
- Modulo
SQL Bitwise Operators
- And
- OR
- exclusive OR
SQL Comparison Operators
- Equal to
- Greater than
- Less than
- Greater than or Equal to
- Less than or Equal to
- Not equal to
SQL Logical Operators
- All
- And
- Any
- Between
- Exists
- In
- Like
- Not
- OR
- Some
SQL BETWEEN and NOT BETWEEN Operators
The BETWEEN operator is Logical operator.The BETWEEN operator selects records between minimum and maximum values. It returns TRUE if the operand is within the range of given values.The BETWEEN operator is used with where clause.Syntax
SELECT[ID]
,[Category]
,[SubCategory]
,[Type]
,[Direction]
,[Model]
,[Side]
,[Supplier]
,[ItemCode]
,[ItemName]
,[PurchasePrice]
,[ReorderPoint]
,[OpeningStock]
,[Location]
,[MeasurementUnit]
FROM tbl_ItemR
where ID BETWEEN 1 and 10
Above SQL statement selects records the range of 1 and 10.The result is shown in Fig. below.
As you can see the record is between the given range of 1 and 10.
The NOT BETWEEN operator acts same as BETWEEN operator with slight difference.
Syntax
SELECT[ID]
,[Category]
,[SubCategory]
,[Type]
,[Direction]
,[Model]
,[Side]
,[Supplier]
,[ItemCode]
,[ItemName]
,[PurchasePrice]
,[ReorderPoint]
,[OpeningStock]
,[Location]
,[MeasurementUnit]
FROM tbl_ItemR
where ID Not BETWEEN 1 and 360
Above SQL statement selects records the range of 1 and 10.The result is shown in Fig. below.
The difference is that NOT BETWEEN operator fetches record greater than the maximum value give,
As you can see that the record set starts from where ID is greater than 360.
For further question please mail: brainstormiert@gmail.com
SQL All Operator
SQL Any Operator
SQL And Operator