使用 MAX + group by:
SELECT BookId,MAX(CreateDate) AS MaxCreateDate FROM Table1 WHERE StationID=2 GROUP BY BookId ORDER BY MaxCreateDate DESC
MAX在这里主要是用于排序。过滤重复的话,group by足矣
posted on 2010-10-19 16:00 左直拳 阅读(143) 评论(0) 编辑 收藏 举报