test = frappe.db.sql(“”“SELECT JSON_Compose(T.customer_gstin, T.name)
FROM
(
SELECT customer_gstin as ‘ctin’, json_arrayagg(name as ‘inum’) AS ‘inv’
FROM tabSales Invoice
) AS T “””, as_dict=1)
test = frappe.db.sql(“”“SELECT JSON_Compose(T.customer_gstin, T.name)
FROM
(
SELECT customer_gstin as ‘ctin’, json_arrayagg(name as ‘inum’) AS ‘inv’
FROM tabSales Invoice
) AS T “””, as_dict=1)