日期:2014-05-19  浏览次数:20368 次

如何按时间大--》小列出新闻,并且同类别新闻只列出唯一一个 ??
如何按时间大--》小列出新闻,并且同类别新闻只列出唯一一个   ??

SELECT   DISTINCT   classID   FROM   news   ORDER   BY   addtime   DESC,newsID   DESC


有错


------解决方案--------------------
select * from news a where not exists
(
select 1 from news where classID=a.classID and addtime> a.addtime
)
order by addtime