I am trying to do a sub select count from a table which has jobs in it with assigned sectors. IE, in tbl_recruitment there is a column called job_sectorID which has sector IDs in it as so: ¬id1¬id2¬id3 etc. I need to do a count depending on the tbl_recruitment_sectors.jo
which is an integer field. I am trying to return a list as so:
Job sector 1 (count of jobs in sector)
Job sector 2 (count of jobs in sectore) etc.
The problem is the sub count sql needs to be a like statment as more than on ID is stored in the tbl_recruitment.job_sector
ID field. Also, the tbl_recruitment_sectors.jo
b_secorID is an integer field whereas tbl_recruitment.job_sector
ID is a varchar field.
Can any one help on this?
SELECT TOP 100 PERCENT CAST(job_sectorID AS varchar) AS @Expr2, job_sectorName,
WHERE dbo.tbl_recruitment.job_sectorID LIKE '% ' & Expr2 & ' %') AS Expr1
ORDER BY job_sectorName