group by count in mysql -
i have 2 tables employee , office. employe table contains columns (emp_id,office_id,firstname,lastname,startdate) office table contaisn columns (office_id,office_name,country)
i query for: countries have offices, , number of employees in country
this give number of employees country.
select o.country, count(*) office o inner join employee e on e.office_id = o.office_id group o.country
Comments
Post a Comment