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

remove duplicates in an sorted array

  using System; public class HelloWorld {          public static void Main(string[] args)     {         int[] ar={2,2,3,3,4,6,6};          C...