In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
ALTER TABLE `user_movement_ log` CHANGE `GatewayId` `GatewayId` int not null default 0 AFTER RegionID
/ / Primary key
Alter table tabelname add new_field_id int (5) unsigned default 0 not null auto_increment, add primary key (new_field_id)
/ / add a new column
Alter table t2 add d timestamp
Alter table infos add ex tinyint not null default'0'
/ / Delete columns
Alter table t2 drop column c
/ / rename the column
Alter table t1 change ab integer
/ / change the type of column
Alter table t1 change b b bigint not null
Alter table infos change list list tinyint not null default'0'
/ / rename table
Alter table t1 rename t2
Indexing
Mysql > alter table tablename change depno depno int (5) not null
Mysql > alter table tablename add index index name (field name 1 [, field name 2 …])
Mysql > alter table tablename add index emp_name (name)
Add the index of the primary key
Mysql > alter table tablename add primary key (id)
Index with unique restrictions
Mysql > alter table tablename add unique emp_name2 (cardnumber)
Delete an index
Mysql > alter table tablename drop index emp_name
Modify the table:
Add fields:
Mysql > ALTER TABLE table_name ADD field_name field_type
Modify the original field name and type:
Mysql > ALTER TABLE table_name CHANGE old_field_name new_field_name field_type
Delete a field:
Mysql > ALTER TABLE table_name DROP field_name
Copy the code
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.