mysql 获取表信息 表备注等

2023-03-10,,

select table_name, table_comment, create_time, update_time from information_schema.tables
-- where table_schema = (select database())  -- 当前数据库

select column_name, (case when (is_nullable = 'no' && column_key != 'PRI') then '1' else null end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type ,column_key
from information_schema.columns where table_schema = (select database()) and table_name = "sys_notice"
order by ordinal_position

mysql 获取信息备注等的相关教程结束。

《mysql 获取表信息 表备注等.doc》

下载本文的Word格式文档,以方便收藏与打印。