SQLSERVER 查询分组后获取每组的最新一条数据
时间:2021-07-01 10:21:17
帮助过:4人阅读
select from (
2 select
3 row_number()
over(partition
by x
order by y
desc)
as rid
4 ,
5 from z
6 )
as tt
7 where tt.rid
=1
13 --按x分组,以y排序
SQLSERVER 查询分组后获取每组的最新一条数据
标签:lse color 代码 over 排序 查询 row serve sqlserver