您的位置:首页 > 数据库 > MySQL

mysql为字段值添加或者去除前缀、后缀

2012-02-27 15:37 113 查看
添加前缀update `ecs_goods` set goods_name=concat('新中式',goods_name) where cat_id =4;

添加后缀update `ecs_goods` set goods_name=concat(goods_name,'新中式') where cat_id =4;

 

删除

update `ecs_goods`set goods_name=right(goods_name,length(goods_name)-1) where cat_id =4;

 

其中ecs_goods为表名,cat_id为分类字段名,goods_name为产品字段名
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql 产品