Skip to content
Advertisement

Scatter multiple rows having duplicate columns to single unique row in postgresql

how to scatter multiple duplicate rows into one row in sql/postgresql.

For example —>

lets i am getting 3 rows of

I want something like this

Its the same thing like groupby in lodash. But how do I achieve the same in postgresql query?

Advertisement

Answer

You’re looking for crosstab

Disclosure: I work for EnterpriseDB (EDB)

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