I have next table with data:
And I run this query:
select *, UNIX_TIMESTAMP(`time`) AS `timeu`, AVG(`value`) AS `valuea`
from `values`
group by `currency`, DATE(`time` - interval 7 day)
order by `id` asc
In result I get
As you can see id
s are: 1, 2, 3, 4, 11, 12
. I want to have 1, 2, 3, 4, 5, 6
- how can I simply build my query to do that?