当前位置:网站首页>MySQL modify data type_ MySQL modify field type [easy to understand]
MySQL modify data type_ MySQL modify field type [easy to understand]
2022-06-30 19:12:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
mysql> alter table Table name modify column Field name type . data In the library address surface city The fields are varchar(30), Modify the type with ( Modify the type carefully , It may cause errors in the original data ).
mysql> alter table address modify column city char(30); You can modify the length with ( Modify the length , Ensure that it is not short of existing data , To ensure that the original data is not wrong )mysql> alter table address modify column city varchar(50);
alter table Table name modify column Field name type ;news Exterior and interior title Field The original length is 100 Characters , The current length should be changed to 130 Characters .
mysql Modify field type :alter table news modify column title text; I found that using this sentence sql You can also directly modify the original type of the field !
It can usually be written as alter table Table name modify column Name The type of the new column, for example :student Columns in the table sname The type is char(20), Now change it to varchar(20),SQL The statement is as follows alter table student modify column sname varchar(20);
Method of modifying column name and column data type at the same time : It can usually be written as alter table Table name change column Old column names New column names New column type student Columns in the table sname The type is char(20), Now change it to stuname varchar(20)alter table student change column sname stuname varchar(20);
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/132251.html Link to the original text :https://javaforall.cn
边栏推荐
- Dlib library for face key point detection (openCV Implementation)
- 拓維信息使用 Rainbond 的雲原生落地實踐
- mysql函数获取全路径
- How to use AI technology to optimize the independent station customer service system? Listen to the experts!
- TCP粘包问题
- 【TiDB】TiCDC canal_ Practical application of JSON
- 详解单例模式
- ONEFLOW source code parsing: automatic inference of operator signature
- Infineon - GTM architecture -generic timer module
- Small program container technology to promote the operation efficiency of the park
猜你喜欢

Redis入门到精通01

Opencv data type code table dtype

Regular expressions (regular matching)

Leader: who can use redis expired monitoring to close orders and get out of here!

PC wechat multi open

sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户

充值满赠,IM+RTC+X 全通信服务「回馈季」开启

Troubleshooting MySQL for update deadlock

3.10 haas506 2.0开发教程-example-TFT

Video content production and consumption innovation
随机推荐
Unlimited cloud "vision" innovation | the 2022 Alibaba cloud live summit was officially launched
[Collection - industry solutions] how to build a high-performance data acceleration and data editing platform
torch.roll
传统微服务框架如何无缝过渡到服务网格 ASM
GameFi链游系统开发NFT技术
Large file transfer software based on UDP protocol
MySQL recursion
com.alibaba.fastjson.JSONObject # toJSONString 消除循环引用
Tensorflow2 ten must know for deep learning
MRO industrial products procurement management system: enable MRO enterprise procurement nodes to build a new digital procurement system
How to do a good job in software system demand research? Seven weapons make it easy for you to do it
Adhering to the concept of 'home in China', 2022 BMW children's traffic safety training camp was launched
《所谓情商高,就是会说话》读书笔记
不同制造工艺对PCB上的焊盘的影响和要求
Distributed transaction
Small program container technology to promote the operation efficiency of the park
CTF流量分析常见题型(二)-USB流量
Huaxing Securities: kitex practice under the original hybrid Cloud Architecture
Geoffrey Hinton: my 50 years of in-depth study and Research on mental skills
充值满赠,IM+RTC+X 全通信服务「回馈季」开启