I have the following problem: I have a XXX table that has the following fields: k803, codrer, period, goal, challenge .
Thetableshowsthegoalandchallengeofeach802storerepresentativeintheJanuary2018period.
Ineededtomakethemediaofthisstoreduringthisperiodandlooklikethis:
Thequestionisthis,Ineedtodothisforeverymonthandputallinformationinasinglequery,forexample"Goal Media and January Challenge", "Goal Media and and February Challenge" ... and so on.
Query of the mean:
SELECT AVG(XXX.META) AS META
, AVG(XXX.DESAFIO) AS DESAFIO
FROM XXX
WHERE XXX.K803 = '802'
AND XXX.periodo = '032018'
Does anyone have an idea if this can be done?