MySQL Forums
Forum List  »  Newbie

Re: count items sold between an arrival date and specific days from that arrival date
Posted by: Peter Brawley
Date: December 29, 2020 06:19PM

Is this what you mean?

select p.item, sum(p.quantity) 
from products p
join arrivals a on a.item=p.item 
                and p.date between a.last_arrival and date_add(a.last_arrival, interval 15 day)
group by p.item;

Options: ReplyQuote


Subject
Written By
Posted
Re: count items sold between an arrival date and specific days from that arrival date
December 29, 2020 06:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.