{
SELECT tp.ProjectID, tp.ProjectName, tp.ProjectDescription, tp.Developer,
tp.Owner, tp.StartDate, tp.CloseDate, tp.ProjectStatus, tp.CompletionPct,
Count(tb.ProjectID) as 'NumberofBugs'
FROM tblBTProject tp
LEFT JOIN tblBTBugs tb ON tp.ProjectID = tb.ProjectID
GROUP BY tp.ProjectID, tp.ProjectName, tp.ProjectDescription, tp.Developer,
tp.Owner, tp.StartDate, tp.CloseDate, tp.ProjectStatus, tp.CompletionPct
}
有没有更好的方法来写这个?我要加入 2 个表(tblBTProject tp 和 tblBTBugs tb)。在 tblBTBugs tb 中有多个 ProjectID 并尝试返回多个项目 ID 计数的列
谢谢