mysql after的用法 mysql用法心得

2021-10-18 08:51:22 字數 1337 閱讀 9414

顯示表結構

describe jin;

將表jin重新命名為chun

rename table jin to chun;

或者alter table jin rename to chun;

重新命名列 --要列出列的型別, column可有可無

alter table jin change column name pass varchar(50);

檢索表show tables like 'jin%'

同一資料庫裡的table1表的內容匯入到table2中?

insert into table2 select * from table1;

##mysql重新命名表,建立外來鍵,增、刪、改列名例項

##增加到某個字段之後

alter table tb_nippon_mms_info add province varchar(50) default null after retcode;

alter table tb_nippon_mms_info add city varchar(50) default null after province;

##增加到某個字段之前

alter table tb_nippon_mms_info add province varchar(50) default null before retcode;

alter table tb_nippon_mms_info add city varchar(50) default null before province;

##刪除名字為states的列

alter table tb_nine_integral_mo_info drop column states ;

##改變手機號碼欄位為約束鍵

alter table business.tb_nine_ticket_popedom change phone phone varchar(50) not null unique;

##改變列名flag為states

alter table tb_nine change flag states tinyint(1);

–重新命名表

rename table t_softwareport to software_port;

–建立外來鍵

alter table software_port add constraint fk_software_port_softwareprocessid foreign key (softwareprocessid)

references software_process (id) on delete restrict on update restrict;

perl中my與local的區別

x 9 sub mm sub gg my sub gg local gg my gg local print x 輸出結果是 call my 11 9 call local 20 20 9 可以看出,local函式在建立全域性變數的乙個區域性例項後即可 將它傳遞給任何子例程並繼續進行區域性初始賦值。...

my97DatePicker的基本使用

開始日 結束日 min代表選擇日期的最小值min laydate.now 1 最小選擇日期為昨天min laydate.now 最小選擇日期為今天min laydate.now 1 最小選擇日期為明天start代表游標指向的位置start laydate.now 1 游標指向昨天start layd...

詳解如何使用DockerHub官方的MySQL映象

前言 最近一直在嘗試以官方centos映象為基礎,製作基於centos的mysql映象。但是製作後發現映象大小已經超過1.5g,這對於一般的docker映象來說太臃腫了。docker hub官方提供的mysql映象才324mb。目前來說我還沒有找到什麼好的方法把我製作的映象的體積減下來,所以就先使用...