select ipv4_src_addr,count(*) AS total_connections from  record  group by ipv4_src_addr  order by total_connections desc limit 1,100

解决方案 »

  1.   

    select id,count(id) as count from tbl_user
    limit 5
    group by id
    order by count
    limit 5
    在我的EMS上试过,是成功的。
      

  2.   

    select id,count(id) as count from tbl_user
    group by id
    order by count
    limit 5
    在我的EMS上试过,是成功的。
      

  3.   

    注:group  by  后跟表的列名,但不能是别名.
    select id,count(id) as count from tbl_user
    group  by id
    order  by count
    limit  5可以通过的.
      

  4.   

    谢谢,我的意思是只对一个表中的前100项内容进行统计和纪录,但是用语句
    “select ipv4_src_addr,count(*) AS total_connections from  record  group by ipv4_src_addr  order by total_connections desc limit 1,100 ”和
    “select id,count(id) as count from tbl_user
    group by id
    order by count
    limit 5”
    都是对表中的所有内容进行统计,然后再从结果中取1到100行数据,
    不符合我的原意。
    请问还有什么方法可以只对表中前面的数据进行统计,先谢谢了
      

  5.   

    select ipv4_src_addr,count(*) AS total_connections 
    from  (select * from record limit 1,100)
    group by ipv4_src_addr  
    order by total_connections desc