SELECT DISTINCT pstampDependent.*
FROM pstampDependent
JOIN pstampJob USING(dep_id)
JOIN pstampRequest USING(req_id)
WHERE pstampDependent.state = 'new'
    AND pstampDependent.fault = 0
    AND pstampJob.state = 'run'
    AND pstampRequest.state = 'run'
