OR
The OR is logical
operator and used to filter the records on one or more condition.
Syntax: The following is the basic syntax of AND keyword
SELECT column1,
column2 FROM your_table_name WHERE Condition1 OR Condition2
Example:
Id
|
Name
|
Age
|
Address
|
Department
|
Gender
|
1
|
Alok Kumar Singh
|
30
|
IN
|
IT
|
Male
|
2
|
Tomas Paul
|
45
|
NZ
|
IT
|
Male
|
3
|
Cristomfer Dee
|
24
|
AU
|
HR
|
Female
|
4
|
Niel Macengi
|
55
|
US
|
BPO
|
Female
|
The following SQL statement selects all employee
of "IT" department or "BPO" department
USE SQLCLR
GO
SELECT * FROM EMPLOYEE WHERE Department='IT' OR Department='BPO'
GO
Id
|
Name
|
Age
|
Address
|
Department
|
Gender
|
1
|
Alok Kumar Singh
|
30
|
IN
|
IT
|
Male
|
2
|
Tomas Paul
|
45
|
NZ
|
IT
|
Male
|
4
|
Niel Macengi
|
55
|
US
|
BPO
|
Female
|
No comments:
Post a comment