Suppose there's a table like this:
+-------+-------+-------+ |YEAR |Name |Score | +-------+-------+-------+ |2019 |Bob |80 | |2019 |David |90 | |2019 |Green |92 | |2019 |Tom |85 | |2020 |Bob |79 | |2020 |David |87 | |2020 |Green |98 | |2020 |Tom |90 | +-------+-------+-------+
I want to write a sql query, and the desired output will look like this:
+-------+-------+-------+-------+-------+ |Date |Bob |David |Green |Tom | +-------+-------+-------+-------+-------+ |2019 |80 |90 |92 |85 | |2020 |79 |87 |98 |90 | +-------+-------+-------+-------+-------+
Any help ?