select Customers.CustomerID,Customers.BussinessName, count(*) as 'Orders' from Customers
inner join CustomerDetails on Customers.CustomerID = CustomerDetails.Cust_ID group by
All i want to do is just to get the customer.BussinessName who has placed the most orders
Any Ideas just a simple query not views or procedures
That is not correct based on the description you gave of what you wanted. You said you wanted a query that would get the customer with the most orders. The query you posted above gives you the name of cust id 5 for order id 1. Rudy gave you a hint with the order by, but you might also want a fetch first. Also you could write a query that isolates the customer ids with their counts and then select the max count to join to your table that has the business name. Last tip, DISTINCT is not required.
Also, wouldn't the customer who has placed the most orders be cust id 4? Granted 5 got more stuff, but all on one order. One other item that puzzles me with your description is that there is a different contact id for each product on an order, wouldn't a customer have the same contact info for each item on an order?