i want to SELECT Data from two tables. The output from the second table should be in JSON Format. The "FOR JSON Path" or "FOR JSON AUTO" cause errors (no valid keyword or JSON not known). I think this has to do with my phpmyadmin (test-environment), that the mysql version is to old.
Are there any other solutions?
Example: Table1 (id, col1, col2)
Table2 (id, attr)
Excepted Result: id, col1, col2, "{id: , attr: "", id: , attr: "" }"
My Test:
SELECT id, col1, col2, (SELECT * FROM table2 FOR JSON PATH)
FROM table1