0
STATUS DEFECT DATE
CLOSED IP 01.01.2012
CLOSED TV 03.03.2012
CLOSED ADSL 05.05.2012
CLOSED ADSL 11.01.2012
CLOSED TV 15.01.2012
NEW TV
NEW TV
我想這組通過計數每個特定缺陷個月。這被認爲是狀態是封閉式
生成的表,我想是:
MONTH TV ADSL IP
January 1 1 1
March 1 0 0
May 0 1 0
我使用的DB2數據庫,以便顯示個月,其作品的部分是:
select case month(timestamp_iso(DATE))
when 1 then 'January'
when 2 then 'February'
when 3 then 'March'
when 4 then 'April'
when 5 then 'May'
when 6 then 'Jun'
when 7 then 'July'
when 8 then 'August'
when 9 then 'September'
when 10 then 'October'
when 11 then 'November'
when 12 then 'December'
end as Month
from TABLE
where STATUS='CLOSED'
group by month(timestamp_iso(DATE))
order by month(timestamp_iso(DATE))
所以,我只是需要添加此部分進行計數。感謝
給je去。 Hvala Nikola :) – Dejan 2012-04-17 12:16:49
;-) molim,Dejane。 – 2012-04-17 12:17:27