【发布时间】:2023-03-26 17:39:02
【问题描述】:
SELECT @query1 := GROUP_CONCAT(CONCAT('SELECT * FROM asterisk.', 表名) SEPARATOR ' UNION ALL ') AS CUSTOMQUERY FROM Information_Schema.tables WHERE table_name LIKE '%custom%'; 从@query1准备stmt;执行语句; DEALLOCATE PREPARE stmt;
..但是在结果的最后我们得到了缺失的查询 像 SELECT * FROM asterisk.custom_70003 UNION ALL SELECT * FROM asterisk.custom_70006 UNION ALL SELECT * FROM asterisk.custom_70007 UNION ALL SELECT * FROM asterisk.custom_70010 UNION ALL SELECT * FROM asterisk.custom_70011 UNION ALL SELECT * FROM asterisk.custom_70042 UNION ALL SELECT * FROM asterisk.custom_70043 UNION ALL SELECT * FRO ..
您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的“FRO”附近使用正确的语法
所以它给了我错误
..我想在我的 SSRS 报告中使用它。和 ssrs querybuilder 提示 我作为参数..所以如果我们在程序中使用它将会有好处 对我来说。因为这样我可以轻松地在我的报告中访问它。
【问题讨论】:
标签: mysql