数据格式:
分组取第一条的效果:
SQL:
SELECT * FROM (
SELECT ROW_NUMBER() OVER(PARTITION BY X ORDER BY Y DESC) RN,
T.*
FROM TEST T
) WHERE RN = 1;
转载自: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,
T.*
FROM TEST T
) WHERE RN = 1;
转载自:http://www.cnblogs.com/dyllove98/archive/2013/07/22/3206423.html