日期:2014-05-18 浏览次数:20566 次
declare @bill table(a int,b nvarchar(20),c nvarchar(20)) insert @bill select 1,'sfs','32' union all select 2,'a','13' union all select 3,'s','32' union all select 4,'d','3a' union all select 9,'f','3q' select distinct d=(select count(1)/3+1 from @bill where a<b.a) into #billnew from @bill b order by d select * from #billnew d ----------- 1 2 (2 行受影响)
------解决方案--------------------
up