[email protected]
在循环中有select语句,如select * from table where a like [email protected]+'%',这样写对吗?
注:[email protected]
不对的话,应该怎么写?
------解决方案--------------------
update tablea set flag = 1
from tablea a , tableb b
where charindex(','+b.b+',' ,','+ replace(replace(replace(replace(a.a,'、',','),',',','),'/',''),'\','')+',' ) > 0
或者:
update tablea set flag = 1
from tablea a , tableb b
where ','+ replace(replace(replace(replace(a.a,'、',','),',',','),'/',''),'\','')+',' like '%,'+b.b+',%'