2
Guys I have the following problem... I have a table XXX that has the following fields: k803, codrer, periodo, meta, challenge.
The table shows the goal and challenge of each store representative 802 in the period of January 2018.
I had to make the media of this store in this period staying like this:
The point is, I need to do this for every month and put all the information in one query just, for example "January goal and challenge media," "goal media and February challenge," ... and so on.
Query average:
SELECT AVG(XXX.META) AS META
, AVG(XXX.DESAFIO) AS DESAFIO
FROM XXX
WHERE XXX.K803 = '802'
AND XXX.periodo = '032018'
Does anyone have any idea if this can be done ?
Put pf to query SQL you used to reach the average you indicated in your question. Also avoid placing images of the query or results, put in formatted text that is easier to read (and facilitates the copy/Paste!).
– João Martins
Perfect .. thanks for the tips. Follow the Query of the average. SELECT AVG(XXX.META) AS META,AVG(XXX.CHALLENGE) AS CHALLENGE FROM XXX WHERE XXX.K803 = '802' AND XXX.period = '012018'
– Alexandre Prezzi