MySQL查询:
SELECT
column_name columnName,
data_type dataType,
column_comment columnComment,
column_key columnKey,
extra
FROM
information_schema.COLUMNS
WHERE
table_name = '表名称'
AND table_schema = ( SELECT DATABASE ( ) )
ORDER BY
ordinal_position
desc 表名称
PostgreSQL查询:
SELECT
*
FROM
information_schema.COLUMNS
WHERE
table_schema = 'public'
AND table_name = 表名称;
SQLite 查询:
PRAGMA table_info(表名称)