I have following table in postgresql:
id | grade | comment
--------------------
01 | A | Good
01 | B | OK
01 | C | BAD
02 | A | Good
02 | E | Very BAD
02 | D | BAD
I want to fetch records in following format
id | grade1 | grade2 | grade3 | comment1 | comment2 | comment3
--------------------------------------------------------------
01 | A | B | C | Good | OK | BAD
02 | A | E | D | Good | Very BAD | BAD
Can anyone help?