请帮我检查一个写法的正确性
create function f_str11(@row1 varchar(20))
returns varchar(400)
as
begin
declare @str varchar(400)
set @str= ' '
---主要是看下面这段话.
select @str=@str+ ', '+scode from Standarddata where Standardrelated like '% '@row1 '% '
-------
set @str=stuff(@str,1,1, ' ')
return @str
end
我用注释符包起来的那段话是不是错了,正确应该怎么写?
谢谢!
[解决办法]
select @str=@str+ ', '+scode from Standarddata where Standardrelated like '% '+@row1+ '% '
[解决办法]
select @str=@str+ ', '+scode from Standarddata where Standardrelated like '%@row1% '
[解决办法]
哦,少了两侧的 "+ "号
[解决办法]
select @str=@str+ ', '+scode from Standarddata where Standardrelated like '% '+@row1+ '% '