SELECT t2.* , t2.RowNumber FROM ( SELECT row_number() OVER ( PARTITION BY t.PartitionColumn ORDER BY t.ID DESC ) RowNumber , t.* FROM Table t ) t2 --WHERE t2.RowNumber = 1 ORDER BY t2.RowNumber ASC
时间: 2024-10-10 16:59:11
SELECT t2.* , t2.RowNumber FROM ( SELECT row_number() OVER ( PARTITION BY t.PartitionColumn ORDER BY t.ID DESC ) RowNumber , t.* FROM Table t ) t2 --WHERE t2.RowNumber = 1 ORDER BY t2.RowNumber ASC