select * from a where id in (select id,max(num) from (select id,count(content) num from a group by id) group by id);

解决方案 »

  1.   

    select * from a where id in (select id from 
    (select count(*) cnt,id from a group by id) where cnt=max(cnt)
    ;
      

  2.   

    上面写错了
    select * from a where id in (select id from (select id,count(content) num from a group by id)  
    where num=(select max(num) from (select id,count(content) num from a group by id)))
      

  3.   

    Above is not working :-)SImple question but actually not simply :
    here is the answer :select * from a 
    where id in (
    select id  from a group by id
    having count(content) = 
     (select max(v.num)
      from
      (select id , count(content) num from a group by id) v))
      

  4.   

    我理解它的“发布内容最多”应该是某人所发布的所有的字符的个数最多吧。上面两位求的是发布信息的条数最多的。
    select * from a,
    (select c.id from (select id,sum(length(content)) as totallen from a group by id) c,(select max(totallen) as totallen from (select id,sum(length(content)) as totallen from a group by id)) d
     where c.totallen=d.totallen) 
    b where a.id=b.id