You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select visited_on, (select sum(amount) from customer where visited_on between date_sub(c.visited_on, interval 6 day) and c.visited_on) as amount, round((select sum(amount) / 7 from customer where visited_on between date_sub(c.visited_on, interval 6 day) and c.visited_on), 2) as average_amount from customer c where visited_on >= (select date_add(min(visited_on), interval 6 day) from customer) group by visited_on;