Alter, change, MODIFY in MySQL

Source: Internet
Author: User

ALTER TABLE project_listCHANGE COLUMN descriptionofproj proj_desc VARCHAR(100),CHANGE COLUMN contractoronjob con_name VARCHAR(30);

MODIFY: Use it to modify only the type of the column without interfering with its name, assuming you want to change the character length of the Proj_desc column to varchar (120) to accommodate more descriptive text, as long as you do so.

ALTER TABLE project_listMODIFY COLUMN proj_desc VACHAR(120);#proj_desc是要修改的列名,VARCHAR(120)是新的数据类型。

summarized as follows;
(1) Change both the column name and the type
(2) Only modify the type, with modify

Alter, change, MODIFY in MySQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.