You are viewing a single comment's thread. Return to all comments →
I don't see any need to do extra calculation rather use truncate function, it takes care about rounding off to the nearest integer value.
Code as below,
select co.continent, trunc(avg(ci.population)) from city ci,country co where co.code = ci.countrycode group by co.continent;
Seems like cookies are disabled on this browser, please enable them to open this website
Average Population of Each Continent
You are viewing a single comment's thread. Return to all comments →
I don't see any need to do extra calculation rather use truncate function, it takes care about rounding off to the nearest integer value.
Code as below,
select co.continent, trunc(avg(ci.population)) from city ci,country co where co.code = ci.countrycode group by co.continent;