sql单个字段分组得到所有列

代码
select * from LYHG_News_Message,(select NewsID,max(Insert_time) as maxTime from LYHG_News_Message group by newsID) as maxTimeMsg
where maxTimeMsg.newsID=LYHG_News_Message.newsID and maxTimeMsg.maxtime=LYHG_News_Message.insert_time

 

posted @ 2010-11-30 15:13  唔愛吃蘋果  阅读(2030)  评论(0编辑  收藏  举报