group by 取倒数第二位。
就是这样的。 具体原因不太明白。 本人SQL确实比较烂。希望高人能指点一二。
主要是这句不太明白,city=t.city and num>t.num
select * from #tb t where exists(
select 1 from #tb where city=t.city and num>t.num
group by city having count(1)=1
)
欢迎大家指点。
主要是这句不太明白,city=t.city and num>t.num
select * from #tb t where exists(
select 1 from #tb where city=t.city and num>t.num
group by city having count(1)=1
)
欢迎大家指点。