Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

find out the customers having maximum number of unique orders. Expand / Collapse
Author
Message
Posted Thursday, June 11, 2009 4:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 24, 2009 12:13 AM
Points: 6, Visits: 30
I have 2 tables with customer id in one coulmn and orderid in another table.
I need to find out the customers having maximum number of unique orders.
finf customer 1 has 4 different orders i need to display the count as 4 against customer 1.
Post #732893
Posted Thursday, June 11, 2009 4:59 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 15, 2014 8:41 AM
Points: 870, Visits: 894
This sounds a bit like a school work type question so without wanting to give too much of an answer I'd suggest you look at the GROUP BY clause - that should help you find the answer.

Karl
source control for SQL Server
Post #732907
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse