Hi Gurus,
I have a table like this.
ProductCode, Qty, SalesPrice, Customer
1001 , 10 , $1000 , A
1001 , 10 , $1000 , B
2001 , 10 , $3000 , A
3001 , 15 , $3000 , A
4001 , 15 , $10000 , B
1001 , 20 , $2000 , B
I will like to query, which customer give me the most sales. And for that customer, which product is most popular.
From the simple table above, Customer B give me the most sales, and Product 4001 is the most popular product for customer B.
I am able to get the most sales by creating a total sum query based on SalesPrice. But how do i find out which product is more popular for that customer?
I have a table like this.
ProductCode, Qty, SalesPrice, Customer
1001 , 10 , $1000 , A
1001 , 10 , $1000 , B
2001 , 10 , $3000 , A
3001 , 15 , $3000 , A
4001 , 15 , $10000 , B
1001 , 20 , $2000 , B
I will like to query, which customer give me the most sales. And for that customer, which product is most popular.
From the simple table above, Customer B give me the most sales, and Product 4001 is the most popular product for customer B.
I am able to get the most sales by creating a total sum query based on SalesPrice. But how do i find out which product is more popular for that customer?
Last edited: