mysql 列出表列名,用逗号隔开

SELECT GROUP_CONCAT(COLUMN_NAME SEPARATOR ",") FROM information_schema.COLUMNS 
WHERE TABLE_SCHEMA = 'db_name' AND TABLE_NAME = 'table_name';

你可能感兴趣的:(DBA)