SQL语句优化- while循环使用 在写一个报表的过程中,需要人员,工号,按日期汇总小时数 方案一:case when 转置 方案二:临时表 现在讨论方案二: Create Procedure UF_Web_OTReportSp( @Startingdate datetime ,@Dept varchar(30) ) AS declare @ReportSet table( id int IDENTITY (1, 1) NOT NULL, name varchar(30), workno varchar(20), dept varchar(20), d1 decimal(8,2), d2 decimal(8,2), d3 decimal(8,2), d4 decimal(8,2), d5 decimal(8,2), d6 decimal(8,2), d7 decimal(8,2), d8 decimal(8,2), d9 decimal(8,2), d10 decimal(8,2), d11 decimal(8,2), d12 decimal(8,2), d13 decimal(8,2), d14 decimal(8,2), d15 decimal(8,2), d16 decimal(8,2), d17 decimal(8,2), d18 decimal(8,2), d19 decimal(8,2), d20 decimal(8,2), d21 decima
[MSSQL]SQL语句优化- while循环使用
关注
打赏