....
SET NOCOUNT ON;
declare @WMaoValue decimal;
declare @NMaoValue decimal;
declare @TotalValue decimal;
if LEN(@ckykmemo)=0
begin
SELECT @WMaoValue = SUM (DCKC ) +SUM (ZHRD ) FROM dbo.tbCCData
where CKYKFlag ='未出清' and MWMao !='内贸' and HTSHR like '%'+@htshr and ChuanMing like '%'+@chuanming and PinMing like '%'+@pinming and MWMao like '%' +@nwmao and RKRQ between @begindate and @enddate SELECT @NMaoValue = SUM (DCKC ) +SUM (ZHRD ) FROM dbo.tbCCData
where CKYKFlag ='未出清' and MWMao ='内贸' and HTSHR like '%'+@htshr and ChuanMing like '%'+@chuanming and PinMing like '%'+@pinming and MWMao like '%' +@nwmao and RKRQ between @begindate and @enddate SELECT @TotalValue = SUM (DCKC ) +SUM (ZHRD ) FROM dbo.tbCCData
where CKYKFlag ='未出清' and HTSHR like '%'+@htshr and ChuanMing like '%'+@chuanming and PinMing like '%'+@pinming and MWMao like '%' +@nwmao and RKRQ between @begindate and @enddate end
如果不采用参数输出形式,怎么能同时返回三个参数的值,并在表中显示出来
??return select @WMaoValue ,@nwmao ,@TotalValue 可以码?
sqlserver
http://msdn.microsoft.com/zh-cn/library/ms187926.aspx