5.Germany德國(人口8000萬),在Europe歐洲國家的人口最多。Austria奧地利(人口850萬)擁有德國總人口的11%。
顯示歐洲的國家名稱name和每個國家的人口population。以德國的人口的百分比作人口顯示。
小數位數
您可以使用函數ROUND 刪除小數。
百分號 %
select name,concat(ROUND(population/(
select population from world
where name='Germany')*100,0),'%')from world
where continent='europe'
Result:
name
Albania 3.000000000000%
Andorra 0.0