Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to operate on fields by mysql

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

How does mysql operate on fields? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

1. Mysql modifies the default value of the field

Alter table tb_mer_team_column drop constraint DF_tb_mer_team_column_columnOrder alter table tb_mer_team_column add constraint DF_tb_mer_team_column_columnOrder default 0 for columnOrder

2. Add fields to the mysql statement

Alter table table1 (table name) add No_id (field name) char (12) (field type) t null | null UNIQUE after 'character' is added after the specified field

3. Mysql modifies the field type

Alter table T1 (table name) alter column a (field name) text (50) (field type)

4. Mysql add primary key field

Alter table tb_mer_basInfo add constraint [PK_tb_merchantBasInfo] primary key (merchantID)

5. Mysql deletes the fields of a table

This is the answer to the question of alter table `lm_ aclass` drop 'cpid' on how to manipulate fields in mysql. I hope the above content can be of some help to you. If you still have a lot of questions to solve, you can follow the industry information channel for more relevant knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report