数据表字段的删除或添加语句

来源:互联网 发布:三维凸包算法 编辑:程序博客网 时间:2024/06/13 16:19
以下操作是在已有的MySql数据库表中进行
删除语句:
alter table 表名 drop column 字段名;
如:
alter table zgglmag drop column dlcode;

添加语句:
alter table 表名 add column 字段名  类型 默认缺省值  备注;
如:
alter table `user_movement_log` Add column GatewayId int not null default 0


给指定字段添加一个值在前面或后面

给指定字段追一个值在前面或是后面:

UPDATE `name` t SET t.username = CONCAT(t.username,"ooo") -- 后

UPDATE `name` t SET t.username = CONCAT("ooo",t.username) -- 前

UPDATE `name` t SET t.username = CONCAT("ooo",t.username,"ooo") --前后

0 0
原创粉丝点击