日期:2014-05-18 浏览次数:20715 次
ALTER FUNCTION [dbo].[f_strAddr](@Oid VARCHAR) RETURNS varchar(8000) AS BEGIN DECLARE @str VARCHAR(8000) SET @str='' SELECT @str=@str+' '+B.COL1 FROM ( SELECT (cast(SUM(A.NUM)AS varchar)+'*'+A.SKU_CODE+'<'+A.PACKING_STANDARD+'>') AS COL1 FROM( SELECT TETP.Oid,SPM.SKU_CODE,SV.PACKING_STANDARD,TETP.NUM*SPM.SKU_QTY AS NUM FROM tEBay_TradeProduct tetp JOIN SKU_PRODUCT_MTM spm ON TETP.SKU=SPM.PRODUCT_CODE JOIN sku_vtzero sv ON SPM.SKU_CODE=SV.CODE WHERE OID=@Oid ) A GROUP BY A.Oid,A.SKU_CODE,A.PACKING_STANDARD ) B --SELECT @str=@str+' '+SKU_CODE FROM TMP t RETURN @str END