SELECT p.ddValue as ddValue1,d2.ddValue as ddValue2,
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)
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
结果和步骤
第一步
第二步
第三步