I have a table that assigns workdays to worker-IDs.
Table: workdays Table: jobs
+------+-------+ +------+-----------+
| id | days | | id | jobs |
+------+-------+ +------+-----------+
| 1 | mon | | 1 | cleaning |
| 1 | tue | | 2 | cooking |
| 2 | sat | | 3 | driving |
| 3 | mon | | 4 | cleaning |
| 3 | tue | | 5 | cooking |
| 3 | sat | +------+-----------+
| 4 | wed |
| 4 | mon |
| 5 | tue |
+------+-------+
This is the query I use to select the IDs of people who work on any of the days I specify (say Monday and Tuesday):
SELECT * FROM workdays WHERE days IN ( 'mon', 'tue' )
Now I'd like to select those people who work on ALL of the days I specify. How can I do that?
edit: Added second table.