TrainityTrainity
All ideas

Please check my query is right or not

with temp as ( select Date, totalhoursspentforjobreviewedeach_day, totaljobreviewedeachday, round(totaljobreviewedeachday/totalhoursspentforjobreviewedeachday) as avgjobreviewedeachhoureach_day from (select ds Date, case when sum(timespend)/3600<=1 then 1 else round(sum(timespend)/3600) end as totalhoursspentforjobreviewedeach_day , count(*) as totaljobreviewedeachday from job_data where month(ds) = 11 and year(ds) = 2020 group by ds) a ) select sum(avgjobreviewedeachhoureachday)/count(Date) from temp;