User Tools

Site Tools


kurs:lov_countries
select name, id from (
SELECT COUNTRIES.COUNTRY_NAME name, 
       COUNTRIES.COUNTRY_ID id,  
       count(locations.location_id) 
FROM LOCATIONS right join COUNTRIES 
on COUNTRIES.COUNTRY_ID = LOCATIONS.COUNTRY_ID
group by COUNTRIES.COUNTRY_NAME, COUNTRIES.COUNTRY_ID
order by count(locations.location_id) desc, country_name asc
)
kurs/lov_countries.txt · Last modified: 2014/09/10 21:22 (external edit)