Weird question... I know. So let me explain.
Here is a my text table
quota | metric_id
100 | 1
20 | 2
100 | 15
50 | 1
30 | 2
20 | 15
50 | 1
200 | 2
10 | 15
I want a SELECT statement that would return the following
id_1 | id_2 | id_15
200 | 250 | 130
Here is what the data is:
Column `id_1` is sum of the 3 rows where `metric_id=1`
Column `id_2` is sum of the 3 rows where `metric_id=2`
Column `id_15` is sum of the 3 rows where `metric_id=15`
Any help?