I am using Oracle 12c DB. I am trying to use the SQL pivot operator to give me a matrix output. I need to display 2 seperate outputs, one with counts and one with percents. I have the following SQL working to get me the counts, but I'm not exactly sure about the SQL for the percents. Please advise. Tx
with pivot_data as (select "score", "Observer_LastName", "profile_id"
from Mytable
where substr("Observer_LastName",1,1) = 'S')
SELECT *
from pivot_data
PIVOT (count("profile_id")
FOR "score" IN ('0','1','2','3')
)