select date(ordered_at), round(sum(amount_paid), 2)
from orders
join order_items on
orders.id = order_items.order_id
group by 1
order by 1;
--for kale-smoothie
select date(ordered_at), round(sum(amount_paid), 2)
from orders
join order_items on
orders.id = order_items.order_id
where name = 'kale-smoothie'
group by 1
order by 1;
No comments:
Post a Comment