0
我不明白,爲什麼這個查詢顯示的結果複製一個月sumbmission的不同計數:爲什麼我有重複的月數
[![SELECT CAST(B.YearNum as varchar(10))+ ' Submitted' as Type,
1 as OrderNum,
COUNT(ControlNo) Count,
b.YearNum, b.MonthNum
FROM tblCalendar b
LEFT JOIN ClearanceReportMetrics a ON b.MonthNum = MONTH(a.EffectiveDate) AND b.YearNum=YEAR(a.EffectiveDate)
AND CompanyLine = 'Plaza Insurance Company' AND Underwriter <> 'Batcheller, Jerry'
WHERE YEAR(EffectiveDate) IN (2016, 2015,2014)
GROUP BY b.YearNum, b.MonthNum, Type
order by b.YearNum, b.MonthNum][1]][1]
OMG!你很對!我怎麼都注意不到! SERG,非常感謝你!!!! – Oleg