1SELECT column_name(s)
2FROM table_name
3WHERE column_name IN (value1, value2, ...);
1SELECT ads.*, location.county
2FROM ads
3LEFT JOIN location ON location.county = ads.county_id
4WHERE ads.published = 1
5AND ads.type = 13
6AND ads.county_id IN (2, 5, 7, 9)
7
1IN condition allows you to easily test
2if an expression matches any value
3in a list of values.
4It is for reducing multiple OR
5conditions in a SELECT, INSERT,
6UPDATE, or DELETE statement.
1+----+----------+----------+
2| ID | NAME | SALARY |
3+----+----------+----------+
4| 3 | kaushik | 2000.00 |
5| 4 | Chaitali | 6500.00 |
6| 5 | Hardik | 8500.00 |
7| 6 | Komal | 4500.00 |
8| 7 | Muffy | 10000.00 |
9+----+----------+----------+
10