select * from ( select ID,GameName,BeginTime,EndTime,CreateTime,IsuseID, row_number() over(partition by GameName order by IsuseID desc) rn from dbo.T_DrawGameInfo)t1
where rn = 1
row_number() OVER (PARTITION BY COL1 ORDER BY COL2) 表示根据COL1分组,在分组内部根据 COL2排序
时间: 2024-10-23 04:29:57