SQL 92 answer.
Re: List by ascending number of orders the customers that have placed more than 1 order?
[sql]SELECT c.id, c.firstname, c.lastname, COUNT(o.order_id) as total
FROM customers c INNER JOIN orders o ON c.customer_id = c.customer_id
GROUP BY c.customer_id, c.lastname
HAVING COUNT(o.order_id) > 1
ORDER BY COUNT(o.order_id) ASC[/sql]
|