将SQL查询转换为JSON

时间:2020-01-22 22:03:55

标签: mysql sql json

我如何将该查询转换为JSON?

SET SESSION group_concat_max_len = 1000000;
SELECT group_concat(q SEPARATOR ' UNION ALL ') 
FROM 
(
SELECT distinct
  concat("select pr.id as 'Practice ID', pr.name as 'Practice Name', l.id as 'Location ID', l.name as 'Location Names', l.print_token as 'Print Tokens', concat(ps.printers, ': ', ps.label) as 'Printer Sets and Printer Names'
from `", table_schema, "`.locations l
join `", table_schema, "`.practices pr on pr.id = l.practice_id
join `", table_schema, "`.printer_sets ps on ps.id = l.practice_id
")  AS q
FROM information_schema.tables
WHERE 
    table_schema LIKE 'uat%' 
) b ;

0 个答案:

没有答案