我有以下查询,我需要为每个工作组选择前 3 个培训。所以我需要每个工作组返回他们的 3 个最高培训。到目前为止的代码是
SELECT Mgmt_Lvl.MGMT_LVL, Book6.[Item ID], Book6.Description, Count(Book6.[User ID]) AS [CountOfUser ID]
FROM Mgmt_Lvl INNER JOIN ((Book6 INNER JOIN O896IA_VEMPPRSA ON Book6.[User ID] = O896IA_VEMPPRSA.SYS_EMP_ID_NR) INNER JOIN O867IA_VPJOBCO ON O896IA_VEMPPRSA.JOB_CLS_CD = O867IA_VPJOBCO.JOB_CLS_CD) ON Mgmt_Lvl.JOB_GRP_CD = O867IA_VPJOBCO.JOB_GRP_CD
GROUP BY Mgmt_Lvl.MGMT_LVL, Book6.[Item ID], Book6.Description
ORDER BY Count(Book6.[User ID]) DESC;
Count(Book6.[User ID]) AS [CountOfUser ID]
是我需要前 3 名的领域