I have a table which consists of city data and temperature of multiple years.
|-----------------------|
| Year | City | Temp |
|-----------------------|
| 2000 | City1 | 25 |
| 2000 | City2 | 29 |
| 2000 | City3 | 35 |
| 2001 | City1 | 17 |
| 2002 | City2 | 28 |
| 2003 | City3 | 19 |
|-----------------------|
I want to represent data in the following way.
|-------------------------------|
| Year | City1 | City2 | City3 |
|-------------------------------|
| 2000 | 25 | 29 | 35 |
| 2001 | 17 | 28 | 19 |
|-------------------------------|
Shall I represent each city each with a sub-table using the when
clause and then join it or is there another simple way?