Reputation: 17
My query is, that I want to filter more than one condition from one column same time. ex)
I want to filter both "Thrissur" and "Ernakulam" from the Place
column simultaneously. So I tried something like this:
SELECT *
FROM student
WHERE Place = "Thrissur" AND Place = "Ernakulam";
Can you please tell me the correct script?
Upvotes: 0
Views: 806
Reputation: 1393
it should be
SELECT * from student where Place="Thrissur" OR Place="Ernakulam";
alternatively
SELECT * from student where Place in ("Thrissur","Ernakulam");
The last one is better if you need to add more places, and it can be replaced by subqueries example SELECT * from student where Place in (Select place from favorites)
Upvotes: 1