thanks chapmandew for the article. Not sure how i would put it into pratice on my problem though..
The thing that confuses me is that i need to select all top level sectors (easy) : -
SELECT sectorid, sector
FROM SECTORS
WHERE parentid is null
i then need to find all child sectorids for EACH parent sectorid and perform a total count on how many jobs are associated with each (maybe using the IN CLAUSE ?) but the problem i am facing is that the CTE cannot be a subquery of the above select statement (correct me if i am wrong) ?. Maybe i need to create a function for the cte and use it within a subquery ?
JT
Main Topics
Browse All Topics





by: chapmandewPosted on 2008-04-08 at 08:32:20ID: 21306259
Have a look at this article I wrote...it may help. If not, I'll work with you on it.
com.com/da tacenter/? p=275
http://blogs.techrepublic.