Sql where multiple values

This article is tagged with: Sql where multiple values and mysql

sql where multiple values

SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1, value2, ...);

sql query with multiple where conditions

+----+----------+----------+
| ID | NAME | SALARY |
+----+----------+----------+
| 3 | kaushik | 2000.00 |
| 4 | Chaitali | 6500.00 |
| 5 | Hardik | 8500.00 |
| 6 | Komal | 4500.00 |
| 7 | Muffy | 10000.00 |
+----+----------+----------+

sql field equals multiple values

SELECT ads.*, location.county
FROM ads
LEFT JOIN location ON location.county = ads.county_id
WHERE ads.published = 1
AND ads.type = 13
AND ads.county_id IN (2, 5, 7, 9)

This article is tagged with: Sql where multiple values and mysql