日期:2014-05-17 浏览次数:21020 次
临时变量可以先放在一边 我想先求这个倍数
select serialcode,s1/s3 from (select serialcode, classnumber, branchquantity from t where t.classnumber in (1,3)) pivot(sum(branchquantity) for classnumber in(1 s1,3 s3)) where s1 is not null and s3 is not null;