查询表中的全部字段:
select COLUMN_NAME from information_schema.COLUMNS where table_name = '表名';
拼接表中全部字段:
select group_concat(COLUMN_NAME) from information_schema.COLUMNS where table_name = '表名';
拼接符
select id,group_concat(name separator ';') from '表名' group by id;
网友评论