17,089
社区成员
发帖
与我相关
我的任务
分享
select * from tb a where not exists(select 1 from tb b where a.name=b.name and a.id>b.id)
select *
from (select a.*,row_number() over(partition by a.name order by id) rn
from tb a)
where rn=1
--是这个意思?
select * from table where (name,class)
in (select distinct name,class from table where class=61)