我想從缺陷數據庫構建查詢。每個缺陷有提交日期和狀態(開,關,延期等),我想我的結果設置有3列:具有相同列的SQL查詢w/2
Date, # bugs w/ Open status, # bugs with Closed status
2012-05-31, 3, 1
2012-06-01, 2, 0
2012-06-02, 3, 2
我不知道如何超越這個查詢得到什麼我想要:
select
DEFECT.SUBMITTED_DATE as "Opened",
count (DEFECT.SUBMITTED_DATE),
DEFECT.STATUS as "Status"
from
DEFECT
where
DEFECT.STATUS='Open' or DEFECT.STATUS='Fixed'
group by
DEFECT.SUBMITTED_DATE
尋找建議。
你想要三列嗎? – Woot4Moo
你正在使用什麼rdbms? MySQL的? SQL Server?甲骨文? –