当前位置:网站首页>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 -- 在末尾添加字段边栏推荐
- 基于交替迭代法的交直流混合系统潮流计算matlab程序iEEE9节点系统算例
- 2022.07.13_Daily Question
- Log4net 思维导图
- Foreign trade website optimization - foreign trade website optimization tutorial - foreign trade website optimization software
- Zabbix6.2惊喜发布!特别优化中大型环境部署的性能!
- 把 VS Code 当游戏机
- SCI写作指南
- 2022.07.14_每日一题
- 【微服务】Nacos集群搭建以及加载文件配置
- 我开发了一个利用 Bun 执行 .ts / .js 文件的 VS Code 插件
猜你喜欢

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

Yu Mr Series 】 【 2022 July 022 - Go Go teaching course of container in the dictionary

LeetCode:952. 按公因数计算最大组件大小【欧拉筛 + 并查集】

2022.07.12 _ a day

MySQL installation to the last step in the write the configuration file failed?And after the installation steps

Shellshock

毫米波技术基础

进程和线程的区别&&run和start区别与联系

《白帽子说Web安全》思维导图

【解决】mysql本地计算机上的MySQL服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止
随机推荐
Environment_Variable_and_SetUID
进程和线程的区别&&run和start区别与联系
The Perfect Guide|How to use ODBC for Agentless Oracle Database Monitoring?
2022.07.12_Daily Question
Tasks and task switching
2022.07.15_每日一题
'vite' is not an internal or external command, nor is it a runnable program or batch file.
Gradle remove dependency demo
[Interview: Concurrency 38: Multithreading: Thread Pool] Basic concepts of the ThreadPoolExecutor class
Leetcode952. 按公因数计算最大组件大小
在 ASP.NET Core 应用程序启动时运行代码的 3 种方法
【Go报错】go go.mod file not found in current directory or any parent directory 错误解决
链表实现及任务调度
DirectExchange switch simple introduction demo
文件 - 05 下载文件:根据文件Id下载文件
页面懒加载
DAY18:Xss 靶场通关手册
2022.07.14_每日一题
2022.07.29_每日一题
【C语言项目合集】这十个入门必备练手项目,让C语言对你来说不再难学!