表中的数据有重复,例如同一个人在表中存在多条数据,只需要随便保留一条
select * from #table a where not exists(select 1 from #table where name=a.name and money<a.money)
表中的数据有重复,例如同一个人在表中存在多条数据,只需要随便保留一条
select * from #table a where not exists(select 1 from #table where name=a.name and money<a.money)