I have a table with about 25 columns to signify locations, I was wondering if there was any way to transpose this results into a cleaner layout? What i have in my SQL is along the lines of:
SELECT sum(isnull(p.[injuryFace],0)) AS [Face]
,sum(isnull(p.[InjuryHead],0)) AS [Head]
,sum(isnull(p.[InjuryEye],0)) AS [Eye]
,sum(isnull(p.[InjuryLeftFinger],0)) AS [Finger - Left]
,....
FROM tbl_OHS_IncidentsPeople P
This gives me a resulting dataset similar to
Face | Head | Eye | Finger - Left | .... |
---------------------------------------------
0 | 1 | 2 | 0 | ... |
What i would like to have in the end is
Area | Count |
------------------------
Face | 0 |
Head | 2 |
Eye | 3 |
Finger - Left | 0 |
No i had a look at Simple way to transpose columns and rows in Sql? which seems to have what i need, but i can't seem to make sense of it in my head because i don't want to transpose the whole table
Any help would be great
Cheers Stephen