原文链接:http://www.cnblogs.com/dyllove98/archive/2013/07/22/3206423.html
数据格式
分组取第一条的效果
sql
SELECT * FROM (SELECT ROW_NUMBER() OVER(PARTITION BY x ORDER BY y DESC) rn, test1.* FROM test1)
原文链接:http://www.cnblogs.com/dyllove98/archive/2013/07/22/3206423.html
数据格式
分组取第一条的效果
sql
SELECT * FROM (SELECT ROW_NUMBER() OVER(PARTITION BY x ORDER BY y DESC) rn, test1.* FROM test1)