-- 根据 身份证 姓名去重 取lsh最小的 那一个
select * from
(select a.*,row_number() over(partition by cardno,name order by lsh ) as rn
from table a) a
where a.rn = 1 order by lsh;
Oracle 分区查询
最新推荐文章于 2022-09-23 09:15:00 发布
-- 根据 身份证 姓名去重 取lsh最小的 那一个
select * from
(select a.*,row_number() over(partition by cardno,name order by lsh ) as rn
from table a) a
where a.rn = 1 order by lsh;