PostgreSQL:如何使用表中的数据创建 json

时间:2020-12-30 13:33:19

标签: sql json postgresql

我有一个包含 column_name 和 json_path 的表来从 json 中提取值。

表格:

| column_name | json_path |
| ----------- | --------- |
| id | {request,id} |
| seller_firstname | {request,seller,firstName} |
| seller_lastname | {request,seller,lastName} |

是否可以使用表中的数据作为任何 posrgres 内置函数的输入来创建这样的 json:

{"request":{"id":1,"seller":{"firstName":"John","lastName":"Doe"}}}

0 个答案:

没有答案
相关问题