我有一個查詢:獲取查詢結果的金額範圍內同一查詢
SELECT case
when Submission__bTracking = 'Phone' then 'Phone'
when Submission__bTracking = 'Web' then 'Web'
when Submission__bTracking = 'Email' then 'Email
when Submission__bTracking = 'Live__bTech__bSupport' then '@ Live Tech Support
when Submission__bTracking = 'Verbal' then 'Verbal Request'
when Submission__bTracking = 'Fax__b__f__bform' then 'Fax/Form'
End as Sub_Tracking,
COUNT(Submission__bTracking) as tickets FROM dbo.MASTER30
WHERE mrSUBMITDATE >= (CONVERT (date, CURRENT_TIMESTAMP -1))
AND mrSUBMITDATE < (CONVERT (date, CURRENT_TIMESTAMP))
GROUP BY Submission__bTracking
產生以下結果:
Sub_Tracking tickets
Email 36
Fax/Form 1
@ Live Tech Support 18
Phone 441
Web 41
我怎麼還生產中所有的門票總和同樣的查詢?
象下面這樣:
Sub_Tracking tickets
Email 36
Fax/Form 1
@ Live Tech Support 18
Phone 441
Web 41
ALL 537
感謝您的幫助!
也許只是做工會,並選擇一個更排它概括這一切? – buhtla