Advertisement

Latest Post

Sunday, 18 September 2016

How to use BETWEEN keyword in Sql

Hello guys , i am sharing between keyword with you 

The BETWEEN keyword (operator) selects values within a range that can be text, numbers or dates.
Syntax:
SELECT column1, column2 FROM your_table_name WHERE column_name BETWEEN value1 AND value2;
 Example: Following is the Employee table 
Id
Name
Age
Address
1
Alok Kumar Singh
30
IN
2
Tomas Paul
45
NZ
3
Cristomfer Dee
85
AU
4
Niel Macengi
55
US




below query we are using between keyword to get employee whose age between 20 to 50
  USE SQLCLR
  GO
  SELECT * FROM EMPLOYEE WHERE AGE between 20 and 50

   GO

Id
Name
Age
Address
Department
Gender
1
Alok Kumar Singh
30
IN
IT
Male
2
Tomas Paul
45
NZ
IT
Male


Government Jobs