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';