So here is the situation. I have 2 tables, customers and order item. Each order item is an element of an order. In each order item record there is a field named quantity that show me the number of that article bought during on each order. I added a summary field on the order item table to get the summary of quantity.
I need to find the top sales article for each customer. Basically the article related to the customer with the biggest sum of quantity. I created a field inside the customer table for it but I'm thinking how to find the article_id of the max for the summary for quantity.
What do you suggest me?