我有这个查询。当我执行时,我得到了 Query 语句,但我想要这个查询的结果集。
我的查询是:
SELECT CONCAT('select * from ', table_name, ' union all ') AS CUSTOMQUERY
FROM information_schema.tables
WHERE table_name LIKE '%custom%'
我得到这个结果
select * from custom_70006 union all
select * from custom_704306 union all
select * from custom_700436 union all
select * from custom_7000643 union all
select * from custom_7000634 union all
select * from custom_700046 union all
select * from custom_700063 union all
select * from custom_700062 union all
但我想要这个特定列的结果集和相应的数据,最后union all
应该删除。
请帮助我进行相关查询。