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