IN clause
Simple IN clause
Section titled “Simple IN clause”To get records having any of the given ids
select *from productswhere id in (1,8,3)The query above is equal to
select *from productswhere id = 1 or id = 8 or id = 3Using IN clause with a subquery
Section titled “Using IN clause with a subquery”SELECT *FROM customersWHERE id IN ( SELECT DISTINCT customer_id FROM orders);The above will give you all the customers that have orders in the system.