All pastes #920354 Raw Edit

Unnamed

public text v1 · immutable
#920354 ·published 2008-02-27 11:29 UTC
rendered paste body
candidate_assessments is a crosstabe between candidates and assessments.
i need all candidates who have completed ALL assigned assessments (status = ' done')

this is what i did, but now i need the count of the records it returns.

SELECT
count(*)
FROM candidate_assessments ca
LEFT JOIN candidate_assessments ca2 ON
 ca2.candidate_id=ca.candidate_id
 AND ca2.status!='done'
WHERE ISNULL(ca2.candidate_id)
group by ca.candidate_id