添加字段:
alter table 表名
Add column 字段名 字段类型 默认值 AFTER 字段名 (在哪个字段后面添加)
例子:
alter table appstore_souapp_app_androidmarket
Add column getPriceCurrency varchar(50) default null AFTER getPrice
修改字段:
alter table表名
change 字段名 新字段名 字段类型 默认值
例子:
alter table appstore_souapp_app_androidmarket change hasPrice hasPrice varchar(10) null;
使用ALTER命令修改字段类型,格式: ALTER TABLE 表名 MODIFY COLUMN 字段名 字段类型定义; 例如: ALTER TABLE chatter_users MODIFY COLUMN ip VARCHAR(50);
删除字段:
alter table 表名 drop column 字段名
例子:
alter table appstore_souapp_app_androidmarket
drop column getPriceCurrency
调整字段顺序:
alter table 表名
change 字段名 新字段名 字段类型 默认值 after 字段名(跳到哪个字段之后)
修改字段顺序
ALTER TABLE `hn_user`
MODIFY COLUMN `region` int(3) NOT NULL COMMENT '会员所属分类' AFTER `password`;
例子:
alter table appstore_souapp_app_androidmarket
change getPriceCurrency getPriceCurrency varchar(50) default null AFTER getPrice
匿名
2025-12-13
大大可以找下哈狗的1030吗,太想要那首歌了~谢谢!
匿名
2025-11-09
https://collaigo.com 免费在线拼图工具
匿名
2025-10-22
盖楼盖楼!
匿名
2025-08-11
沙发沙发
匿名
2025-08-10
https://at.oiik.cn/bing.html
匿名
2025-02-21
实用,我在开发https://minmail.app/时候使用到了