当前位置:网站首页>mysql插入新字段方法
mysql插入新字段方法
2022-07-31 06:39:00 【CNS2900761382】
MySQL 允许在开头、中间和结尾处添加字段
一,开头
MySQL 默认在表的最后位置添加新字段,开头位置(第一列的前面)添加新字段,那么可以使用 FIRST 关键字
ALTER TABLE <表名> ADD <新字段名> <数据类型> [约束条件] FIRST
alter table XXX add XXX int first -- 在开头添加字段
二,中间
MySQL 允许在中间位置(指定的字段之后)添加字段,此时需要使用 AFTER 关键字,AFTER 可以将新字段添加到某个已有字段后面
ALTER TABLE <表名> ADD <新字段名> <数据类型> [约束条件] AFTER <已经存在的字段名>;
alter table XXX add XXX int after XXX -- 在指定字段之后添加字段三,末尾
mysql默认在表的最后位置(最后一列的后面)添加新字段
ALTER TABLE <表名> ADD <新字段名><数据类型>[约束条件];
alter table XXX add XXX int -- 在末尾添加字段边栏推荐
猜你喜欢

Financial leasing business

Core Tower Electronics won the championship in the Wuhu Division of the 11th China Innovation and Entrepreneurship Competition

【面试:并发篇38:多线程:线程池】ThreadPoolExecutor类的基本概念

Thread 类的基本用法——一网打尽

SCI写作指南

进程调度的基本过程

双倍数据速率同步动态随机存储器(Double Data Rate Synchronous Dynamic Random Access Memory, DDR SDRAM)- 逻辑描述部分

【面试:并发篇37:多线程:线程池】自定义线程池

DirectExchange switch simple introduction demo

PCB抄板
随机推荐
【Go报错】go go.mod file not found in current directory or any parent directory 错误解决
从 Google 离职,前Go 语言负责人跳槽小公司
2. (1) Chained storage of stack, operation of chain stack (illustration, comment, code)
【微服务】(十六)—— 分布式事务Seata
Financial leasing business
Machine Learning - Notes and Implementation of Linear Regression, Logistic Regression Problems
Jobject 使用
把 VS Code 当游戏机
2022.07.20_Daily Question
多进程全局变量失效、变量共享问题
【解决】mysql本地计算机上的MySQL服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止
2022.07.20_每日一题
Zotero | Zotero translator plugin update | Solve the problem that Baidu academic literature cannot be obtained
Chapter 16: Constructing the Magic Square for Prime Numbers of Order n(5,7)
Kubernetes scheduling
文件 - 07 删除文件: 根据fileIds批量删除文件及文件信息
CNN--各层的介绍
360 push-360 push tool-360 batch push tool
nohup principle
2022.07.18_每日一题