查询列名,返回多列:
SELECT COLUMN_NAME
FROM `information_schema`.`COLUMNS`
WHERE `TABLE_SCHEMA` = 'schema_name' AND TABLE_NAME = 'table_name';
查询列名,返回单列:
SELECT GROUP_CONCAT(COLUMN_NAME SEPARATOR ',')
FROM `information_schema`.`COLUMNS`
WHERE `TABLE_SCHEMA` = 'schema_name' AND TABLE_NAME = 'table_name';
参考
(30 words)