项目使用sql

1 替换title中内容
update aodfeed.recommend set title = replace(title ,'//',',') where title like '%//%';
2 mysql 中从另外一个表中copy数据
insert into wildcarddetail
(wildcardid, detail)
SELECT word_package_id, word_name
FROM word_package_replacement;
3 mysql 修改列名
alter table wildcardinfo change picurl picurl1 text;
4 修改表的字段的默认属性
alter table wildcardinfo modify column picurl1 text not null comment '攻略图片1';
5 表中添加字段
ALTER TABLE users
ADD COLUMN count SMALLINT(6) NOT NULL AFTER lastname,
ADD COLUMN log VARCHAR(12) NOT NULL AFTER count,
ADD COLUMN status INT(10) UNSIGNED NOT NULL AFTER log;

你可能感兴趣的:(项目使用sql)