行变列
2009-08-25 11:15 蜡笔小旧 阅读(150) 评论(0) 编辑 收藏 举报ALTER FUNCTION dbo.GetFullTextJoinStringAmount ( @ObjId UNIQUEIDENTIFIER, @condition NVARCHAR(100) ) RETURNS VARCHAR(1000) AS BEGIN DECLARE @a VARCHAR(1000) SELECT @a = ISNULL(@a+',','') + CAST(Amount AS VARCHAR(100)) FROM dbo.CommonAmount WHERE ObjId = @ObjId AND CAST(Amount AS VARCHAR(100)) LIKE @condition RETURN @a END GO