SQL Between

SQL Between Clause

SQL โ€“ Between Clause is used to select the between the two specified range.

SQL Between Clause Syntax

SELECT ColumnName1,ColumnName2โ€ฆ FROM TableName WHERE columnName BETWEEN Range1 AND Range2 ;

Suppose We Have the following Table :

tableFull

Example

SELECT * FROM Users WHERE ID BETWEEN 5 AND 8 ;

Will Produce The Following Result :

Between_clause

SQL โ€“ NOT Between Clause Syntax-

NOT BETWEEN Clause selects only those records which does not come in the specified range.

SELECT ColumnName1,ColumnName2โ€ฆ FROM TableName WHERE columnName NOt BETWEEN Range1 AND Range2 ;

Example

SELECT * FROM Users WHERE ID NOT BETWEEN 5 AND 8 ;

Will Produce The Following Result :

SQL Between SQL_NOT_BETWEEN_CLAUSE


Advertisements

Add Comment

๐Ÿ“– Read More