Tuesday, 20 July 2021

sql group by

 


add sql total staff and sub and percentage it with round values.

 SELECT BRANCH, SUM(TotalStaff)AS TotalStaff ,

  SUM (SCRESSubscription)as SCRESSubscription,

CAST( ROUND(sum(SCRESSubscription) * 100.0 / sum( TotalStaff),2)as decimal(5,2)) as Percentage



  FROM BranchWiseDataBZANew21062021

  GROUP BY BRANCH 





No comments:

Post a Comment

Enviri JD for BI

  Job Description: Experience working closely with business users/leaders. Well-versed in requirement gathering and can lead business users ...