MySQL获取所有表及表结构
1、获取所有表属性,语句如下:select table_name tableName,engine,table_comment tableComment,table_collation tableCollation,create_time createTimefrom information_schema.tableswhere table_schema = (select database())
·
1、获取所有表属性,语句如下:
select table_name tableName,
engine,
table_comment tableComment,
table_collation tableCollation,
create_time createTime
from information_schema.tables
where table_schema = (select database())
order by create_time desc
2、获取表结构,语句如下:
select column_name columnName,
data_type dataType,
column_comment columnComment,
column_key columnKey,
extra ,
is_nullable as isNullable,
column_type as columnType
from information_schema.columns
where table_name = 't_sys_personnel'
and table_schema = (select database())
order by ordinal_position;
更多推荐
已为社区贡献2条内容
所有评论(0)