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为产品字段名
添加后缀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为字段值添加或者去除前缀、后缀
- mysql为字段值添加或者去除前缀、后缀
- sql函数,为某个字段的值加前缀或者后缀
- mysql 在修改添加字段(alter table 表名 add column 或者 modify column)且带unique时提示duplicate entry for key的原因以及解决方案
- Mysql 批量删除前缀或者后缀表
- Oracle 给某列前后添加后缀或者前缀
- MYSQL给表或者字段写注释
- [5月28日的脚本] 在SharePoint 2010列表或者文档库中添加自定义字段
- MySQL添加字段和修改字段的方法
- MYSQL的添加字段和修改字段
- mysql中查询字段为null或者不为null
- mysql添加多个字段
- mysql 5.5之后没有了password字段,这样添加一条root用户
- 正在运行mysql添加字段注意事项
- MySQL添加字段和修改字段的方法
- MySQL入门——数据表的修改1:往指定表中添加单列(字段)
- mysql给表和字段添加注释
- mysql去除多列组合重复(并添加组合唯一索引)
- Mysql批量删除前缀或者后缀表
- Mysql中修改字段类型、长度以及添加删除列