PostgreSQL multiple row as columns
Clash Royale CLAN TAG #URR8PPP PostgreSQL multiple row as columns I have a table like this: | id | name | segment | date_created | question | answer | |----|------|---------|--------------|----------|--------| | 1 | John | 1 | 2018-01-01 | 10 | 28 | | 1 | John | 1 | 2018-01-01 | 14 | 37 | | 1 | John | 1 | 2018-01-01 | 9 | 83 | | 2 | Jack | 3 | 2018-03-11 | 22 | 13 | | 2 | Jack | 3 | 2018-03-11 | 23 | 16 | And I want to show this information in a single row, transpose all the questions and answers as columns: | id | name | segment | date_created | question_01 | answer_01 | question_02 | answer_02 | question_03 | answer_03 | |----|------|---------|--------------|-------------|-----------|-------------|-----------|-------------|-----------| | 1 | John | 1 | 2018-01-01 | 10 | 28 | 14 | 37 | 9 | 83 | | 2 | Jack | 3 | 2018-03-11 | ...