select * from 表 tem where date in (select top 3 date from 表 where topid=tem.topid order by date desc)

解决方案 »

  1.   

    感谢,能不能告诉我 tem是什么?
      

  2.   

    1.
    select * from topic tem where time in (select top 3 time from topic where topic=tem.topic order by time desc)order by topic2.
    select *  from topic a where (select count(*) from topic b where a.topic=b.topic and b.TIME<=a.TIME)<=3 ORDER BY topic
      

  3.   

    select *  from 表 a where (select count(*) from 表 b where a.topic=b.topic and b.date字段>=a.date字段)<=3
      

  4.   

    //感谢,能不能告诉我 tem是什么?tem是给你“表”定义的别名