2
PostgreSQL使用JSONB加入
我有这个SQL: CREATE TABLE test(id SERIAL PRIMARY KEY, data JSONB); INSERT INTO test(data) VALUES ('{"parent":null,"children":[2,3]}'), ('{"parent":1, "children":[4,5]}'), ('{"parent":1, "children":[]}'), ('{"parent":2, "children":[]}'), ('{"parent":2, "children":[]}'); 这将给: id | data ----+-------------------------------------- 1 | {"parent": null, "children": [2, 3]} 2 | {"parent": 1, "children": [4, 5]} 3 | {"parent": 1, "children": []} 4 | {"parent": …