20221122 常用MySQL查询

查询版本

select version();

查询编码


查询表名和表注释

select TABLE_NAME, TABLE_COMMENT
from INFORMATION_SCHEMA.Tables
where table_schema = 'daoancomp';

查询表字段和注释

select COLUMN_NAME,
#        COLUMN_TYPE,
       substring_index(COLUMN_TYPE, '(', 1)                                                                       type,
       substr(COLUMN_TYPE, locate('(', COLUMN_TYPE) + 1, locate(')', COLUMN_TYPE) - locate('(', COLUMN_TYPE) - 1) len,
       COLUMN_COMMENT
from INFORMATION_SCHEMA.Columns t
where table_schema = 'daoancomp'
  and table_name = 'user';
posted @ 2022-11-22 14:06  流星<。)#)))≦  阅读(14)  评论(0编辑  收藏  举报