Голова Робота
Просветленный
(36338)
4 года назад
Ты правильно извлекаешь population из Германии. Но где деление?
select name, population / (select population from world where name = 'Germany')
from world
where name <> 'Germany'
and continent = 'Europe'
Александр СоловьевМастер (1455)
4 года назад
Добрый день. Как показать вывод % по каждой стране? ROUND(population/(select population from world where name='Germany'), 0)
Спасибо
+----------+--------+
| Albania | 3% |
| ...| 0% |
| ...| 11% |
| ...| ...|
+----------+--------+
Необходимо разделить население каждой страны в Европе на население Германии. Вывести name, %. Код не работает. Подскажите, пожалуйста, что подправить.
Мой код
select name, concat(ROUND(population, 0))
from world
where population in
(select population
from world
where name = 'Germany')
and continent = 'Europe'
Спасибо