Skip to main content
1 of 3
Sandeep
  • 113
  • 1
  • 5

Pivoting in PostgreSQL

I have a scenario where i have to pivot a list of rows to columns dynamically. Attaching a sample input table and desired output.I'm using postgreSQL and have tried crosstab function but the results is not correct.

enter image description here

Desired output

Sandeep
  • 113
  • 1
  • 5