Skip to content
Advertisement

Postgresql how to change row to column

lets say i have a table like this:

and i want to create a table like this with query

what query should i type to show a table like above?

using colpivot or crosstab?

Advertisement

Answer

You can try to use UNION ALL

Query 1:

Results:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement