我需要从查询完全结构化的JSON得到结果.我可以在postgres中看到,有些内置函数可能很有用.
作为一个例子,我创建了如下结构:
-- Table: person
-- DROP TABLE person;
CREATE TABLE person
(
id integer NOT NULL,
name character varying(30),
CONSTRAINT person_pk PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE person
OWNER TO postgres;
-- Table: car
-- DROP TABLE car;
CREATE TABLE car
(
id integer NOT NULL,
type character varying(30),
personid integer,
CONSTRAINT car_pk PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE car
OWNER TO postgres;
-- Table: wheel
-- DROP TABLE wheel;
CREATE …
Run Code Online (Sandbox Code Playgroud)