У меня есть часть запроса ниже, где я создал новые столбцы на основе условий:
select
sum(case when Overall_Time_Spent < 0 then 1 else 0 end) as Errors,
sum(case when Overall_Time_Spent between 0 and 3 then 1 else 0 end) as _0_3_days,
sum(case when Overall_Time_Spent = 4 then 1 else 0 end) as _4_days,
sum(case when Overall_Time_Spent = 5 then 1 else 0 end) as _5_days,
sum(case when Overall_Time_Spent between 6 and 8 then 1 else 0 end) as _6_8_days,
sum(case when Overall_Time_Spent >= 9 then 1 else 0 end) as more_than_9_days,
avg(case when Overall_Time_Spent < 0 then 100.0 else 0 end) as Errors_percent,
avg(case when Overall_Time_Spent between 0 and 3 then 100.0 else 0 end) as _0_3_percent,
avg(case when Overall_Time_Spent = 4 then 100.0 else 0 end) as _4_percent,
avg(case when Overall_Time_Spent = 5 then 100.0 else 0 end) as _5_percent,
avg(case when Overall_Time_Spent between 6 and 8 then 100.0 else 0 end) as _6_8_percent,
avg(case when Overall_Time_Spent >= 9 then 100.0 else 0 end) as more_than_9_days_percent,
Как я могу добавить запрос в этот, где я могу добавить ДВА БОЛЬШЕ столбцов, которые дают мне суммувсех сумм и сумм всех avg
Заранее спасибо