SQL Server BETWEEN Operator
The BETWEEN operator selects a range of data between two values. The values can be numbers, text, or dates. The BETWEEN operator will be used in combination of Where Clause.
Syntax:
SELECT column_name(s) FROM table_name WHERE column_name
BETWEEN Value1 AND Value2
Example :
Let us suppose we have and EMP Table as follows :
Criteria :
The BETWEEN operator selects a range of data between two values. The values can be numbers, text, or dates. The BETWEEN operator will be used in combination of Where Clause.
Syntax:
SELECT column_name(s) FROM table_name WHERE column_name
BETWEEN Value1 AND Value2
Example :
Let us suppose we have and EMP Table as follows :
Criteria :
If we want to select the Employees whose salary between 30000 and 50000 , use the below query.
Select *from EMP E WHERE E.Salary BETWEEN 30000 and 50000
Select *from EMP E WHERE E.Salary BETWEEN 30000 and 50000
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.