摘要: select * from t1 where id in(select min(id) from t1 group by name)SELECT * FROM t1 a WHERE [time]= ( SELECT TOP 1 [time] FROM t1 WHERE name=a.name ORDER BY [Time] DESC )Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->--按某一字段分组取最大(小)值所在行的数据/*数据如下:n 阅读全文
posted @ 2010-11-22 11:14 小锋神 阅读(528) 评论(0) 推荐(0) 编辑