0
我有表格。Postgresql加入jsonb
Orders表:
id: integer
items: jsonb
項目表:
id: integer
title: string
price: integer
例如爲了記錄
id: 1,
items: {
"1"=>{"qty"=>3},
"3"=>{"qty"=>12}
}
例如項目記錄
id:1, title: "Tesla model S"
id:2, title: "Tesla model W"
id:3, title: "Tesla model D"
請幫助得到的結果:
id:1, title: "Tesla model S", qty: 3
id:3, title: "Tesla model D", qty: 12