question

advgal avatar image
advgal asked

How to apply PIVOT to this group by query

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

pivotgroup-by
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.