MainMenu

Home Java Overview Maven Tutorials

Sunday, 15 January 2017

SQL And & OR keyword with example

And, OR Keyword

Used to get more filtered record
Table: <
Emp_idEmp_nameEmp_regEmp_salary
01chandanE_0125000
02adhirajE_0230000
03raghuE_0335000
04AlaxE_0440000
you need to find the Emp_name which have Emp_reg = R01 & Emp_id = 1
Select Emp_name from Salary Where Emp_reg = "R01" and Emp_id = 1
RESULT:
chandan Consider above table again & suppose you need to find the Emp_name which have Emp_reg = "R01" or Emp_id = 2 Select Emp_name from Salary Where Emp_reg = "R01" OR Emp_id = 2
RESULT:
chandan
adhiraj

Tag:SQL And, OR query with example, Use of SQL AND OR with example

No comments:

Post a Comment