通常用 describe 或 explain 可以显示表的构造信息,但有时只需要看看字段名称就好,不需要显示那些 Type, Null, Key 等等信息,那就用下面的命令:
SELECT column_name
FROM information_schema.columns
WHERE table_name = ‘your_table’
AND table_schema = ‘database_name’
通常用 describe 或 explain 可以显示表的构造信息,但有时只需要看看字段名称就好,不需要显示那些 Type, Null, Key 等等信息,那就用下面的命令:
SELECT column_name
FROM information_schema.columns
WHERE table_name = ‘your_table’
AND table_schema = ‘database_name’