mysql SQL語句積累
更新時(shí)間:2011年09月15日 00:02:44 作者:
mysql SQL語句積累,學(xué)習(xí)mysql的朋友可以參考下。
--重命名表
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;
--刪除列
alter table software_type drop column upid, drop column orderid;
--修改列名
alter table software_process change software_id softwareid int(11) not null;
--更改列編碼
alter table cms_contentbody modify column offical_site_name varchar(30) character set utf8 collate utf8_unicode_ci not null;
--增加列
alter table cms_flash add name varchar(30) not null unique;
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;
--刪除列
alter table software_type drop column upid, drop column orderid;
--修改列名
alter table software_process change software_id softwareid int(11) not null;
--更改列編碼
alter table cms_contentbody modify column offical_site_name varchar(30) character set utf8 collate utf8_unicode_ci not null;
--增加列
alter table cms_flash add name varchar(30) not null unique;
相關(guān)文章
mysql從一張表查詢批量數(shù)據(jù)并插入到另一表中的完整實(shí)例
這篇文章主要給大家介紹了關(guān)于mysql從一張表查詢批量數(shù)據(jù)并插入到另一表中的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-01-01
Lost connection to MySQL server at ''reading authorization p
這篇文章主要介紹了Lost connection to MySQL server at 'reading authorization packet', system error: 0錯(cuò)誤解決方法,需要的朋友可以參考下2014-08-08

