SELECT , GROUP AND DISPLAY IN TABULAR FORM I Have a table as above. How can I get an output (as shown below) with a single mysql query.
SELECT location,
       AVG(CASE WHEN qtr = 'Q1' THEN achievement END) q1-average,
       AVG(CASE WHEN qtr = 'Q2' THEN achievement END) q2-average
FROM sourcetable
-- WHERE year = '2018'
GROUP BY location;