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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -