View Single Post
  #2 (permalink)  
Old 05-23-2006, 11:56 PM
alexfr alexfr is offline
Junior Member
 
Join Date: May 2006
Posts: 24
alexfr is on a distinguished road
Default MySQL answer. Re: list customers with average ordered quantities?

[sql]
SELECT c.nb, c.name, Avg (o.qty)
FROM customers c, orders o
WHERE c.nb=o.nb
GROUP BY c.nb, c.name
HAVING Count (*) > 1
[/sql]
Reply With Quote