- 查找数据库全部表名并拼接
SELECT
GROUP_CONCAT('"' ,table_name ,'"')
FROM
information_schema.TABLES
WHERE
table_schema = '表名'
- 查找表中所有字段并拼接
SELECT
GROUP_CONCAT( '"',column_name, '"')
FROM
information_schema.COLUMNS
WHERE
table_name = 'exam_answer'
SELECT
GROUP_CONCAT('"' ,table_name ,'"')
FROM
information_schema.TABLES
WHERE
table_schema = '表名'
SELECT
GROUP_CONCAT( '"',column_name, '"')
FROM
information_schema.COLUMNS
WHERE
table_name = 'exam_answer'
评论区