sql实现字符串的截取和替换

 

update goods_products set goods_name= substring(goods_name,0,CHARINDEX('</b>',goods_name))
 where siteid=2 and goods_name like '%</b>%'

 

原文:摩托罗拉手机XT800(智尚黑)</b>天翼3GAndroidMOTO巅峰之作,卓越者引领时势

替换后:摩托罗拉手机XT800(智尚黑)

posted @ 2011-11-02 18:54  学-无-止-境  阅读(1277)  评论(0编辑  收藏  举报