prasanna kumar

prasanna kumar

  • NA
  • 41
  • 7.5k

How to calculate Sum of row of each column using MSSQL

Aug 28 2019 5:02 AM
This is my temp table and its query and the content.
 
SELECT EMPID,EMPName,[Note making],[Blind activity],Oral,[Listening skills],Understanding,Creativity,Practical,Application,Computation,
Concept,[Mental Ability],[TotalGr]
into #temptable FROM 
    (
        SELECT            dbo.EMP_Basic_Information.DeptID,
                             dbo.EMP_Basic_Information.FirstName + ' ' + dbo.EMP_Basic_Information.MiddleName + ' ' + dbo.EMP_Basic_Information.LastName AS EMPName,
                             dbo.EMP_Basic_Information.Sal, dbo.EMP_Basic_Information.Quality
        FROM            dbo.EMP_Basic_Information
        WHERE        (dbo.EMP_Basic_Information.DeptID = 25)
                )
        as s
        PIVOT
        (
             AVG(Sal)
             FOR [Quality] in ([Note making], [Blind activity], Oral,[Listening skills], Understanding, Creativity, Practical, Application, Computation, Concept, [Mental Ability], [TotalGr])
    )
    AS Pivot_alias
 
 
 
 
And our requirement is as 
 
 
 

 Thanks in advance.
 
 
 
 

Answers (4)