Recursive Query Help
Posted on 2008-10-07
I have this query that gives me the postingFacilityID and total openings.
SELECT DISTINCT j.postingFacilityID, SUM(j.true_job_cnt) AS tot_openings, ff.facilityName
FROM jobInfo j, facilities f
WHERE j.display = 'Y'
AND j.dateClose >= GetDate()
AND j.facilityID = f.facilityID
and f.statusid = 1
and f.deleted = 0
GROUP BY j.postingFacilityID
ORDER BY SUM(j.true_job_cnt) DESC
What I want is to be able to use the resultant postingFacilityID and get the facility name which would be in the facilities table as "facilityName".