i want to get some row values as column sum of which column is reading date basis
SELECT * FROM `mitre_details`;
id reading date
1 500 2019-07-15
2 300 2019-07-15
3 600 2019-07-15
4 800 2019-07-15
5 900 2019-07-15
1 200 2019-07-16
2 250 2019-07-16
3 400 2019-07-16
4 550 2019-07-16
5 790 2019-07-16
Tried Query:
SELECT date,sum(reading) FROM `mitre_details` GROUP BY date;
Desired Output:
Date Reading Mitre 1 Mitre 2 Mitre 3 Mitre 4 Mitre 5
2019-07-15 3100 500 300 600 800 900
2019-07-16 2190 200 250 400 550 790