我試圖在同一個表上總結以下三個查詢的結果以生成一個單一報表。從每個查詢如何總結同一表的三個不同查詢的結果
SELECT b.BG_SEVERITY as Severity, count (b.BG_BUG_ID) as Total
FROM BUG b where
b.BG_USER_12='QA3'
group by b.BG_SEVERITY
SELECT s.BG_SEVERITY as Severity, count (s.BG_BUG_ID) as Total
FROM BUG s where
s.BG_USER_12='QA1'
group by s.BG_SEVERITY
SELECT a.BG_SEVERITY as Severity, count (a.BG_BUG_ID) as Total
FROM BUG a where
a.BG_USER_12='QA2'
group by a.BG_SEVERITY
結果將類似於下面:
Severity Total
1-Critical 4
2-High 94
3-Medium 23
4-Low 45
我期待從上述三個查詢組合/總結中的「合計」一欄。我可以用什麼SQL功能來做到這一點?
如果其中一個答案解決了您的問題,請將其標記爲已接受。 :) –