日期:2014-05-18  浏览次数:20598 次

怎么将表中一个字段上符合条件的记录加上相应的字符串??
如表a中有一个字段username,怎么将username中包含 "p "字符的在username字段值前面加上 "this "字符
即原来是 tupss,因包含 "p ",故替换成 "thistupss "

------解决方案--------------------
update 表a
set username= 'this '+username
from 表a
where charindex( 'p ',username)> 0