干嘛用varchar(50)存储时间?
按时间倒序排列就行。

解决方案 »

  1.   

    select  a.fsp_id,a.fsp_fst_id,
     a.fsp_title,a.fsp_time,a.fsp_score 
    from fgavnet_search_posting a,
    fgavnet_search_replies b 
    where a.fsp_id=b.fsr_fsp_id 
    order by convert(datetime,b.fsr_time) desc
    =================================
    以上是按最近回复时间来查询,但是遇到一个问题,
    查询出来的有重复的数据,于是又改成这样:
    -----------------------------------------
    select distinct convert(datetime,b.fsr_time),
    a.fsp_id,a.fsp_fst_id,
     a.fsp_title,a.fsp_time,a.fsp_score 
    from fgavnet_search_posting a,
    fgavnet_search_replies b 
    where a.fsp_id=b.fsr_fsp_id 
    order by convert(datetime,b.fsr_time) desc
    -----------------------------------------
    可是依旧不行,还是除不掉重复数据,且不满中条件2,发表一个新贴的时候,这个新贴应该
    查询出来放在列表页的第一个,后面依次排列最近有回复的贴子...
      

  2.   

    存储最后回复时间,然后select...order by 回复时间  desc