亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Mysql中返回一個(gè)數(shù)據(jù)庫的所有表名,列名數(shù)據(jù)類型備注

 更新時(shí)間:2010年04月28日 22:52:02   作者:  
在Mysql中怎樣返回一個(gè)數(shù)據(jù)庫的所有表名,列名數(shù)據(jù)類型備注
desc 表名;
show columns from 表名;
describe 表名;
show create table 表名;

use information_schema
select * from columns where table_name='表名';


順便記下:
show databases;
也可以這樣

use information_schema

select table_schema,table_name from tables where table_schema='數(shù)據(jù)庫名'

use 數(shù)據(jù)庫名;
show tables;
原有一unique索引AK_PAS_Name(PAC_Name)在表tb_webparamcounter中,
執(zhí)行以下sql修改索引
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name);


若發(fā)現(xiàn)索引的邏輯不對(duì),還需要再加一個(gè)字段進(jìn)去,執(zhí)行
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name,PAC_Value);
注意:這時(shí)的PC_ID,PAC_Name,PAC_Value三個(gè)字段不是FOREIGN KEY
否則必需先drop FOREIGN KEY,再重做上一步才行


獲取列名數(shù)據(jù)類型備注
SELECT COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT FROM information_schema.columns WHERE table_name = ?

相關(guān)文章

最新評(píng)論