I am using a PostgreSQL database and have a table as follows:
--------------------------------------
| Date | MetricType | MetricValue |
--------------------------------------
| date1 | MetricA | val |
--------------------------------------
| date1 | MetricB | val |
--------------------------------------
| date1 | MetricC | val |
--------------------------------------
| date2 | MetricA | val |
--------------------------------------
| date2 | MetricB | val |
--------------------------------------
| date2 | MetricC | val |
--------------------------------------
As you can see, each date has a set of metric types and each type has a value. I want to write a Select statement which combines this data in the following manor
------------------------------------------
| Date | MetricA | MetricB | MetricC |
------------------------------------------
| date1 | val | val | val |
------------------------------------------
| date2 | val | val | val |
------------------------------------------
I am not sure how to go about writing this Select statement to get these results. Can anyone help?