This works before I put the CONCAT statement in. I was hoping to return a tuple for the uploads field based off of the subquery.
def my_query():
conn = create_connection()
cur = conn[0]
cur.execute("""SELECT d.id, s.val1, d.val2, s.val3, d.val4,
r.val5, r.val6, r.val7,
CONCAT(SELECT u.id, u.file_name, u.file_path FROM related_docs u WHERE u.icd_id = d.id)
AS uploads
FROM icd_d d, icd_s s, icd_r r
WHERE d.id = s.icd_id
AND d.id = r.icd_id
ORDER BY id ASC
""")
data = cur.fetchall()
return data
(afterCONCAT?