Skip to content
Advertisement

Get data horizontal in SQL

I have this query:

It’s returning:

I’m trying to make it like this, if anyone could help me, thanks

Advertisement

Answer

You can pivot using conditional aggregation:

It is unclear what the specific values are that go into each column.

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