Andrew Braithwaite wrote:
Are you using MySQL?
yes of course :)
OK, if you are then first simplify your query:
group by 1
thanks, I didn't know it.
Then add the AVG column which will work ok with the "group by" :
select date_format(dt_imp,'%Y/%m') as date,
SUM(imp),
Are you using MySQL?
OK, if you are then first simplify your query:
select date_format(dt_imp,'%Y/%m') as date,
SUM(imp)
from sp
group by 1
order by 1
Then add the AVG column which will work ok with the "group by" :
select date_format(dt_imp,'%Y/%