select hosp_type, adm_type, count(*) as cnt from raw.stacked_prime group by hosp_type, adm_type
how do I convert this to show hosp_type as columns, admit_type as rows, and its count filled in the table? Tried multiple ways no luck
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
Answers Answers and Comments
23 People are following this question.
Grouping Count Values Once Across Multiple Columns
How to convert multiple rows into one row in SSRS?
Can I PIVOT this without resorting to CASE statements?
SQL Pivot Query
Get source data behind a pivot table in a spreadsheet automatically and dynamically.