select * from T1 where Location in
(select top 1 * from (
select location,count(*) as reccount
from T1 group by location) x order by reccount desc)
(select top 1 * from (
select location,count(*) as reccount
from T1 group by location) x order by reccount desc)
where location = (select top 1 location from table1
group by count(location)
order by count(*) desc
)
select *
from T1
where Location in (select Location
from T1
group by Location
having count(*) = (select max(f)
from (select count(*) f
from T1
group by Location) T))
2.(如果人数最多的location多于一个不能处理,加with ties即可)
select *
from T1
where Location in (select Top 1 with ties Location
from T1
group by Location
order by count(*) desc)