34,838
社区成员




select a.* from 表 a where age = (select top 1 age from 表 where name = a.name) order by a.name
declare @t table(
name varchar(50),
age int
)
insert into @t
select 'a1',18
union all
select 'a1',16
union all
select 'a1',12
union all
select 'a2',19
union all
select 'a3',20
select a.[name],max(age) as age
from @t a
group by [name]