The AND Operator is used to display
result on the basis of both condition are TRUE (means first and second
condition are true).
When more than one logical operator is used in a
statement, the AND operators
are evaluated first.
Syntax:
The AND Operator return the Boolean
expressions that is TRUE or FALSE.
Syntax:
The basic syntax of AND operator with
WHERE clause is as follows:
SELECT column1, column2, columnN
FROM table_name
WHERE
[condition1] AND [condition2]...AND [conditionN];
Examples:
Please Read the Previous Article for SQL-Table Structure
Example1
Fetch First_name, Last_name, Salary, Department and City fields from the Employee table where First_name is Philip AND salary is 750000.
SELECT First_name,Last_name, Salary, Department, City
FROM Employee
Example2
Fetch First_name,Last_name, Salary, Department and City fields from the Employee table where City is Delhi AND salary greater than 650000.
SELECT First_name,Last_name, Salary, Department, City
FROM Employee
Example3
Fetch First_name,Last_name, Salary, Department and City fields from the Employee table where City not in Delhi AND salary less than 1000000.
SELECT First_name,Last_name, Salary, Department,City
FROM Employee
WHERE City !='Delhi' AND Salary <
1000000.00
No comments :
Post a Comment
Ask a Question?