解决方案 »

  1.   

    参考下贴中的多种方法http://blog.csdn.net/acmain_chm/article/details/4126306
    [征集]分组取最大N条记录方法征集,及散分....
      

  2.   

    update xinxi a , (
    select ID
    from xinxi u
    where 3>(select count(*) from xinxi where comid=u.comid and ID<u.ID)
    ) b
    set a.rank=2 
    where a.ID=b.ID
      

  3.   

    qq_20523975
    loveruochen
    等级:Blank
    结帖率:0%当您的问题得到解答后请及时结贴.
    http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
    http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
    http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html8、如何给分和结贴?
    http://community.csdn.net/Help/HelpCenter.htm#结帖
      

  4.   

      MySQL分组排序取前N条记录 以及 生成自动数字序列 的SQL: http://blog.csdn.net/mchdba/article/details/22163223