-- count etymological entries (sanue) for each language
SELECT k.id, k.nimi, COUNT(s.id)
FROM `kieli` k
LEFT JOIN `sanue` s 
ON (
   k.id = s.kieli_id
) 
GROUP BY (k.id) 
HAVING (COUNT(s.id) > 0) 
ORDER BY COUNT(s.id) ;

