Use of joins for finding results

Posted by Raj.Trivedi under ASP.NET on 2/11/2013 | Points: 10 | Views : 659 | Status : [Member] [MVP] | Replies : 1
Hello team,

i am using northwind database,i want to find how many customers and customer info who has placed orders for exactly five different products.

I also want to find thr customer who has made the highest purchase in amount.

Regards,
Raj.Trivedi

Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved



Responses

Posted by: Ankitsrist on: 2/11/2013 [Member] Starter | Points: 25

Up
0
Down
query for your 2nd question..
SELECT TOP 3 customer, SUM(amount) AS totalamount FROM customerdata GROUP BY customer


query for your 1st question could something like
SELECT customer , count(*) AS product FROM customerdata GROUP BY customer HAVING COUNT(*)>4 


Raj.Trivedi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response