为什么我无法为此查询获取正确的行字段?

时间:2016-09-30 05:06:32

标签: mysql sql

 select  CountryCode,Language, floor(max(percentage)) as speakers 
  from countrylanguage 
  group by CountryCode;

直观我希望语言与表countrylanguage中的最大百分比相对应。然而,这似乎不起作用。我应该在这里改变什么才能使它发挥作用? 更多信息:

desc countrylanguage;
+-------------+---------------+------+-----+---------+-------+
| Field       | Type          | Null | Key | Default | Extra |
+-------------+---------------+------+-----+---------+-------+
| CountryCode | char(3)       | NO   | PRI |         |       |
| Language    | char(30)      | NO   | PRI |         |       |
| IsOfficial  | enum('T','F') | NO   |     | F       |       |
| Percentage  | float(4,1)    | NO   |     | 0.0     |       |
+-------------+---------------+------+-----+---------+-------+

1 个答案:

答案 0 :(得分:2)

std::function