'insert into '+@ResultTable
+ ' select a.EXITSTATION,b.STATIONNAME,11,RTRIM('+@TollDate+')+''a.exitdate'',a.recordtype,
sum(sign(a.vehicleclass^1)^1) ,
sum(sign(a.vehicleclass^2)^1) ,
sum(sign(a.vehicleclass^3)^1) ,
sum(sign(a.vehicleclass^4)^1) ,
sum(sign(a.vehicleclass^11)^1) ,
sum(sign(a.vehicleclass^12)^1) ,
sum(sign(a.vehicleclass^13)^1) ,
sum(sign(a.vehicleclass^14)^1) ,
sum(sign(a.vehicleclass^15)^1) ,
0,0,0
from '+@BaseTable+ ' AS A,BASE_STATION380 AS B'
+' where 1=1 '+case when @Record<>'' then ' and a.Recordtype&'+@Record+'='''+@Record+''' ' else '' end
+' and a.EXITSTATION = B.STATIONID'
+' and a.Exitstation = '+ CASE ISNULL(@Station,'')
WHEN '' THEN 'a.Exitstation'
ELSE @Station
END
+' and a.EXITDATE = '+ CASE ISNULL(@Exitdate,'')
WHEN '' THEN 'a.EXITDATE'
详细解决方案
怎么将这两个值组合到一起
热度:59 发布时间:2016-04-24 21:17:33.0
相关解决方案