SQL problem - Customer Placing the Largest Number of Orders
Problem
My Query
SELECT t.customer_number
FROM (
SELECT customer_number, COUNT(*) as total
FROM Orders
GROUP BY customer_number
ORDER BY total DESC
LIMIT 1
) AS t
Editorial Solution
SELECT
customer_number
FROM
orders
GROUP BY customer_number
ORDER BY COUNT(*) DESC
LIMIT 1
;