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;

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐