Postgres在MySQL中的row_to_json函数

时间:2014-08-29 07:49:45

标签: mysql sql json postgresql

这个Postgres查询有没有漂亮而整齐的翻译成MySQL的?基本上,我想将table_1中的值复制到table_2中,但是以json格式复制,table_2不是第一个普通形式。

INSERT INTO table2(json_meta_data) SELECT row_to_json(row(field_1, field_2)) FROM table_1;

PS:我不确定Postgres中此查询的正确性,但我用Google搜索并找到了Postgres has such functions

0 个答案:

没有答案