Sunday, 9 October 2011

DML-select-And ,or

nThe AND operator displays a record if both the first condition and the second condition is true.
nThe OR operator displays a record if either the first condition or the second condition is true.
Syntax:
üSELECT columnname from table where columnname=‘value1’ and columnname=‘value2’
üSELECT columnname from table where columnname=‘value1’ or columnname=‘value2’
Query:
SELECT * FROM EMPtbl1 WHERE EMPname=‘Batista‘ AND Salary=’20,000‘
SELECT * FROM  EMPtbl1 WHERE EMPname=‘Batista‘ OR Salary= ’90,000‘ 

No comments:

Post a Comment