Is there any pretty and neat translation of this Postgres query into a MySQL one? Basically, I want to copy values from table_1 into table_2, but in json format, with table_2 not being in first normal form.
INSERT INTO table2(json_meta_data) SELECT row_to_json(row(field_1, field_2)) FROM table_1;
PS: I am not sure about the correctness of this query in Postgres, but I googled and found out Postgres has such functions.
Answer for MySQL 5.7+
Check https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html