你可以使用创建一个表(例如。
tab
)与
json
列(例如。
jsondata
)通过使用
json_array_elements()
create table tab as
with tab as
(
select '[
{
"sequence": 123123.0,
"Card number ": "12312qwe",
"Tracking number": 1231233.0,
"Expiry Date": 43741.0
},
{
"sequence": 123123.0,
"Card number ": "12312qwe",
"Tracking number": 1231233.0,
"Expiry Date": 43741.0
},
{
"sequence": 123123.0,
"Card number ": "12312qwe",
"Tracking number": 1231233.0,
"Expiry Date": 43741.0
}
]'::json as jsondata
)
select js ->> 'sequence' as sequence, js ->> 'Card number ' as Cardnumber,
js ->> 'Tracking number' as Trackingnumber, js ->> 'Expiry Date' as ExpiryDate
from
(
select json_array_elements(jsondata) as js
from tab
) q1
Demo