mysql为字段值添加或者去除前缀、后缀(查询字段拼值)


添加前缀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为产品字段名


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM