SELECT
temp.*
FROM
( SELECT *, Row_Number ( ) OVER ( partition BY enterid ORDER BY itemendtime DESC ) AS rank FROM summary ) temp
WHERE
rank = 1
SQLServer 获取回去分组中最新数据
最新推荐文章于 2024-06-30 21:16:43 发布
SELECT
temp.*
FROM
( SELECT *, Row_Number ( ) OVER ( partition BY enterid ORDER BY itemendtime DESC ) AS rank FROM summary ) temp
WHERE
rank = 1