The table request has foreign key fields job and user. I need to pull the subset of rows for which one user has both a row for both job = 35 and job = 34.
Is this query doing the job correctly? I believe it is.
SELECT * FROM `request`
WHERE `job` = 35 AND `fulfilled` is NULL
AND
`user` IN
(SELECT `user` FROM `request` WHERE `job` = 34 AND `fulfilled` is NULL )
1 Answer