My database has a table with the following fields:
TPI
CLICKS
IMPRESSION
CLASSIFY
I am looking to retrieve 3 specific results:
1) Calculate SUM(CLICKS)/SUM(IMPRESSION) * 100 GROUPED BY TPI
2) Calculate SUM(IMPRESSION) WHERE CLASSIFY = "XYZ" GROUPED BY TPI
3) Calculate SUM(IMPRESSION) WHERE CLASSIFY = "ABC" GROUPED BY TPI
The desired output format is:
TPI 1st_data 2nd_data 3rd_data
I want the output to only include unique entries for TPI. Is there a way to achieve this using a single query?
Thank you in advance!