//表结构
select *
from information_schema.columns
where table_name='pre_house' and TABLE_SCHEMA = 'house'
//常用
select column_name as name,column_comment as remark,data_type as type,is_nullable as is_null
from information_schema.columns
where table_name='pre_house' and TABLE_SCHEMA = 'house'
//表注释
select *
from information_schema.TABLES
where table_name='pre_house' and TABLE_SCHEMA = 'house'
//表外键
select *
from information_schema.KEY_COLUMN_USAGE
where table_name='pre_house' and TABLE_SCHEMA = 'house' and POSITION_IN_UNIQUE_CONSTRAINT ='1'
mysql 查询表结构,表注释,表外键
最新推荐文章于 2024-06-13 15:48:38 发布