COUNT(t.id) as num,YEAR(t.buildDate) as years
FROM tm_case t
LEFT JOIN pd_datadict_detail p on t.source=p.code LEFT JOIN pd_datadict_detail d2 ON t.caseProperty=d2.id
WHERE p.typeId='68' and YEAR(t.buildDate)>(?-4)
GROUP BY p.ddValue,d2.ddValue ,YEAR(t.buildDate) ORDER BY years
結果和步驟
第一步
第二步
第三步