Sql Query,如何将23,4585688作为230000这样的舍入值

时间:2015-05-21 11:43:40

标签: mysql sql

如果有一个值如23,948948 ....那我怎么能把它作为像23,000000的圆值

select ROUND(gdp/population, 0) from world where GDP >= 1000000000000

这是输出,我正在......

ROUND(gdp/pop..
66442
11115
44739
6122
39620

实际结果在哪里,

ROUND(gdp/pop..
Australia   66000
Brazil  11000
Canada  45000
China   6000
France  40000

3 个答案:

答案 0 :(得分:0)

select ROUND(gdp/(population*1000), 0)*1000 from world where GDP >= 1000000000000

答案 1 :(得分:0)

select ROUND(gdp/population, -3) from world where GDP >= 1000000000000

答案 2 :(得分:-1)

您可以按如下方式使用查询:

 select country_name, round(gdp/pop) from  WORLD where GDP >= 1000000000000;