SELECT CityName, Count(ClientID) as ClientCount
FROM City
INNER JOIN Client
        on City.CityID = Client.CityID
GROUP BY CityName
HAVING ClientCount > 30;


Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

"Ronan Lucio" <[EMAIL PROTECTED]> wrote on 09/10/2004 11:14:37 AM:

> Hello,
> 
> A have two tables:
> 
> City:
>     CityID
>     CityName
> 
> Client:
>     ClientID
>     ClienteName
>     CityID
> 
> How can I make a SELECT that returns me only the cities
> that have more than 30 (example) clients?
> 
> Thanks,
> Ronan
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 

Reply via email to