- mysql查询表所有字段的属性和注释
select * from information_schema.columns where table_name='表名'
- mysql获取表的所有字段信息
SELECT
column_name columnName,
data_type dataType,
column_comment columnComment,
column_key columnKey,
extra
FROM
information_schema.COLUMNS
WHERE
table_name = 'user'
AND table_schema = ( SELECT DATABASE ( ) )
ORDER BY
ordinal_position