日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
MySQL更改表結構的添加與刪除

下面的文章主要講述的是MySQL更改表結構的添加、刪除以及修改字段與調(diào)整字段順序的實際操作步驟,以下就是文章對MySQL更改表結構的添加、刪除以及修改字段與調(diào)整字段順序的具體操作步驟的描述,望你瀏覽之后會有所收獲。

創(chuàng)新互聯(lián)專注于企業(yè)全網(wǎng)整合營銷推廣、網(wǎng)站重做改版、浮梁網(wǎng)站定制設計、自適應品牌網(wǎng)站建設、成都h5網(wǎng)站建設、電子商務商城網(wǎng)站建設、集團公司官網(wǎng)建設、外貿(mào)營銷網(wǎng)站建設、高端網(wǎng)站制作、響應式網(wǎng)頁設計等建站業(yè)務,價格優(yōu)惠性價比高,為浮梁等各大城市提供網(wǎng)站開發(fā)制作服務。

MySQL更改表結構添加字段:

 
 
 
  1. alter table `user_movement_log`  
  2. Add column GatewayId int not null default 0 AFTER `Regionid` (在哪個字段后面添加) 

MySQL更改表結構刪除字段:

 
 
 
  1. alter table `user_movement_log` drop column Gatewayid 

MySQL更改表結構調(diào)整字段順序:

 
 
 
  1. ALTER TABLE `user_movement_log` CHANGE `GatewayId` `GatewayId` int not null default 0 AFTER RegionID 

主鍵

al

 
 
 
  1. ter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id); 

增加一個新列

 
 
 
  1. alter table t2 add d timestamp;  
  2. alter table infos add ex tinyint not null default ‘0′; 

刪除列

 
 
 
  1. alter table t2 drop column c; 

重命名列

 
 
 
  1. alter table t1 change a b integer; 

改變列的類型

 
 
 
  1. alter table t1 change b b bigint not null;  
  2. alter table infos change list list tinyint not null default ‘0′; 

重命名表

 
 
 
  1. alter table t1 rename t2; 

加索引

 
 
 
  1. > alter table tablename change depno depno int(5) not null;  
  2. > alter table tablename add index 索引名 (字段名1[,字段名2 …]);  
  3. > alter table tablename add index emp_name (name); 

MySQL更改表結構中加主關鍵字的索引

 
 
 
  1. > alter table tablename add primary key(id); 

加***限制條件的索引

 
 
 
  1. > alter table tablename add unique emp_name2(cardnumber); 

刪除某個索引

 
 
 
  1. >alter table tablename drop index emp_name; 

修改表:

增加字段:

 
 
 
  1. > ALTER TABLE table_name ADD field_name field_type; 

修改原字段名稱及類型:

 
 
 
  1. > ALTER TABLE table_name CHANGE old_field_name new_field_name field_type; 

刪除字段:

 
 
 
  1. > ALTER TABLE table_name DROP field_name; 

以上的相關內(nèi)容就是對MySQL更改表結構添加、刪除、修改字段、調(diào)整字段順序的介紹,望你能有所收獲。

【編輯推薦】

  1. 數(shù)據(jù)庫訪問妙招在Linux之下
  2. 修改密碼的6個好用方案
  3. 配置與卸載實操
  4. 讓支持中文的實際操作步驟
  5. 4.1 數(shù)據(jù)轉換的指導

新聞標題:MySQL更改表結構的添加與刪除
鏈接URL:http://www.5511xx.com/article/cdhohsc.html