select max(字段列表)
from 表名
group by level_count

解决方案 »

  1.   

    select  id ,contents, max(get_count),level_count
    form 表名
    group by level_count
      

  2.   

    select max(字段列表)
    from 表名
    group by level_count可以么?max(字段列表)这个字段列表写什么?写*???
      

  3.   

    to  b(大海)
    实践证明你的方法是错误的,错误信息
    服务器: 消息 8120,级别 16,状态 1,行 2
    列 'table2.id' 在选择列表中无效,因为该列既不包含在聚合函数中,也不包含在 GROUP BY 子句中。
    服务器: 消息 8120,级别 16,状态 1,行 2
    列 'table2.contents' 在选择列表中无效,因为该列既不包含在聚合函数中,也不包含在 GROUP BY 子句中。
      

  4.   

    up up up up up up up up up up
      

  5.   

    我想要一步查出来结果呀。
    select *
    语句一下得到啊。
      

  6.   

    select  id ,contents, max(get_count),level_count
    form 表名
    group by level_count
      

  7.   

    select id ,contents, max(get_count) as get_count ,level_count
    form 表名 group by level_count order by id