如果我按照产量汇总,然后加一列,这列按照汇总产量的大小
排上序号. 请问我应该怎么做呢???
------解决方案--------------------
--如果需要第一列,需要借助臨時表
Select ID = Identity(Int, 1, 1), matcode, SUM(digit) As 产量 Into #T From 表 Group By matcode
Select * From #T
Drop Table #T
------解决方案--------------------
select id=identity(int,1,1), matcode,sum(digit)as total into #t1 from #t group by matcode order by sum(digit)