Answer to this query was received as -
SELECT location, AVG(CASE WHEN qtr = 'Q1' THEN achievement END) q1-average, AVG(CASE WHEN qtr = 'Q2' THEN achievement END) q2-average FROM sourcetable GROUP BY location
Now, the problem is while counting the instances generated with the above query. The final output I require as shown below -
Can such output be generated using a single query?