各位高手,帮个忙解决一下这个问题啊,十分感谢了!!这是一个发贴的表的结构:id(标识列),sid(贴子版块号),ttopic(贴子标题),tcontents(贴子内容),tclickcount(点击次数)问题:显示各版块点击率最高的贴子,结果要求如下id  sid  topic  tcontents                  tclickcount
3   1    求助!  各位帮个忙....                1000  (点击率最大的)

解决方案 »

  1.   

    select id,sid,topic,tcontents,tclickcount
    from tab t1
    where t1.tclickcount=(select max(tclickcount) from tab t2 where t2.id=t1.id)
      

  2.   

    select * from tablex where tclickcount = (select   MAX(tclickcount)   from   tablex)
      

  3.   

    select id,sid,topic,tcontents,tclickcount
    from tab t1
    where t1.tclickcount=(select max(tclickcount) from tab t2 where t2.sid=t1.sid)