select
id,
row_number() over(PARTITION BY id ORDER BY id DESC) rn
from table
where rn=1
取 排序 最大的一条数据 row_number() over(PARTITION BY
最新推荐文章于 2024-11-13 10:59:25 发布
select
id,
row_number() over(PARTITION BY id ORDER BY id DESC) rn
from table
where rn=1