Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone tell me how to use multiple where conditions in SQL?

1 Answer

0 votes
by (119k points)

You can use AND, OR, and IN operators to use multiple conditions in where clause. Here are three examples of how you can use multiple conditions in where clause:

If you want to find the employee details whose salary is greater than 40000 and age less than 25.

SELECT EMP_ID, Employee_Name, Salary

FROM CUSTOMERS

WHERE Salary > 40000 and AGE < 25;

If you want to find the employee details whose salary is greater than 40000 or age less than 25.

SELECT EMP_ID, Employee_Name, Salary

FROM CUSTOMERS

WHERE Salary > 40000 or AGE < 25;

If you want to find the employee details whose location is Bangalore or Hyderabad.

SELECT EMP_ID, Employee_Name, Salary

FROM CUSTOMERS

WHERE Location in (‘Bangalore’, ‘Hyderabad’);

I recommend enrolling in this SQL course by Intellipaat to learn SQL. 

Related questions

0 votes
1 answer
0 votes
1 answer
asked Oct 19, 2020 in SQL by dev_sk2311 (45k points)
0 votes
1 answer
asked Jul 13, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...