MySQL field Common operations Add, modify, delete, adjust field order

Source: Internet
Author: User

Organize your memo:

To Add a field :
ALTER TABLE table name
Add column field FirstName type default after field name (after which field is added)

Example:

Alter Table Appstore_souapp_app_androidmarket ADD column varchar (+)   default NULL After GetPrice

To Modify a field :
ALTER TABLE table name
Change field name new field FirstName type default value

Example:

Alter Table varchar (ten)  null;
ALTER TABLE BIGINT (NULL' system order number ' )

To delete a field :
ALTER TABLE table name drop column field name

Example:

Alter table Appstore_souapp_app_androidmarket<BR>dropcolumn Getpricecurrency

To adjust the order of fields :
ALTER TABLE table name
Change field name new field FirstName type default after field name (after which field is skipped)

Example:

Alter table Appstore_souapp_app_androidmarket<BR>varchar(50 )&nbsp; & default NULL After GetPrice

Original: http://blog.csdn.net/changemyself/article/details/5976207

MySQL field Common operations Add, modify, delete, adjust field order

Related Article

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.