求一段SQL代码

2025-12-18 00:12:23
推荐回答(2个)
回答1:

select pid,Sum(count) from [表名] group by pid order by sum(count) desc

回答2:

CREATE TABLE 订单 ( id int(1) NOT NULL , pid varchar(3) NOT NULL , price char(3) NOT NULL , count int(1) NOT NULL PRIMARY KEY (id))