SELECT * from
(
SELECT intUserID as [KidId], intAssessmentID as [assid] ,vchTopic as [Topics] from ManageAssessment WHERE intUserID=174 and IsRorW='yes'
)AS S
pivot
(
COUNT(KidId)
FOR assid IN ([22],[19],[16],[17],[18])
)AS s
Hey its my code to create a Table i want to add other columns but it coming wrongly..! i want a column after column 4 i.e, difference of 2 value.can anyone help me to solve.. Thank you.....enter image description here