pgsql 查每个版本最新的数据

select uuid from(select *,row_number() over(partition by productid order by time_stamp desc)rn
from "automation".data)t where rn=1

posted @ 2021-07-08 17:48  一杯清茶一本书  阅读(148)  评论(0编辑  收藏  举报