22,298
社区成员
发帖
与我相关
我的任务
分享create table tb(数量 int,编号 int)
insert into tb select 50,1
insert into tb select 29,1
insert into tb select 30,2
insert into tb select 80,3
select top 1 编号 from tb
group by 编号
order by sum(数量) desccreate table tb(数量 int,编号 int)
insert into tb select 50,1
insert into tb select 70,1
insert into tb select 30,2
insert into tb select 80,3
select top 1 编号 from tb
group by 编号
order by count(编号) desc