Saturday 8 September 2012

I would like to find the customer, who has Highest order count in SQL Table

I would like to find the customer, who has Highest order count.



SOLUTION:

;with t as
(
select customer,count(customer) as cnt_cust from orders   group by customer
)
select top 1 * from t


RESULT:


Powered by: Codersspace webtech solutions Codersspace webtech solutions

0 comments:

Post a Comment


                                                            
 
Design by Abhinav Ranjan Sinha