MySQL 数据库查询字段名称、字段解释、中文名称、表名称、表注释等
SELECT
case when locate('_',column_name) >0 then
concat(lower(left(column_name,locate('_',column_name)-1)),upper(substring(column_name,locate('_',column_name)+1,1)),lower(substring(column_name,locate('_',column_name)+2)))
else lower(column_name) end as column_name,
data_type,
column_comment,
table_name,
(select table_comment from information_schema.tables where table_schema='oop'and table_name = information_schema.columns.table_name ) as table_comment
FROM
information_schema.columns
WHERE
table_name in (select distinct table_name from information_schema.columns where table_schema = 'oop')
ORDER BY
ORDINAL_POSITION,table_name;