个人常用sql记录

发布于 2024-10-23  169 次阅读


1.逗号分隔获取字段名(备注)
SELECT GROUP_CONCAT(COLUMN_NAME SEPARATOR ', ') AS field_names
FROM information_schema.COLUMNS
WHERE table_name = 'robot_private'//表名
AND table_schema = 'tg_schedule';//数据库名称

SELECT GROUP_CONCAT(COLUMN_COMMENT SEPARATOR ', ') AS COLUMN_COMMENTS
FROM information_schema.COLUMNS
WHERE table_name = 'robot_private'
AND table_schema = 'tg_schedule';
一个练习时长还差一年半的切图仔,有需求可联系 QQ:963827384
最后更新于 2024-10-23