Question: Here's what I have so far as an SQL Query: SELECT CUSTOMERS.CustID, CUSTOMERS.Cname, COUNT(DISTINCT ORDERS.OrderID) AS 'Nbr of Orders' FROM CUSTOMERS LEFT JOIN ORDERS ON

Here's what I have so far as an SQL Query:

SELECT CUSTOMERS.CustID,

CUSTOMERS.Cname,

COUNT(DISTINCT ORDERS.OrderID) AS 'Nbr of Orders'

FROM CUSTOMERS LEFT JOIN ORDERS ON CUSTOMERS.CustID = ORDERS.CustID

GROUP BY CUSTOMERS.CustID, CUSTOMERS.Cname

ORDER BY 'Nbr of Orders' DESC

It gives me a list of 'Nbr of Orders' in decending order, but I want only the top ranking item to appear. How do I do that? I need this as soon as possible. It is due soon.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!