--根据 x 分组后、根据 y 排序后取第一条select * from ( select ROW_NUMBER() over(partition by x order by y desc) RowNum ,testTable.* from testTable) as t1 where RowNum = 1
本文共 207 字,大约阅读时间需要 1 分钟。
--根据 x 分组后、根据 y 排序后取第一条select * from ( select ROW_NUMBER() over(partition by x order by y desc) RowNum ,testTable.* from testTable) as t1 where RowNum = 1
转载于:https://www.cnblogs.com/ssda/p/9264444.html