我在 Postgres 9.4 中有下一张表
CREATE TABLE public.neuro (
nid int4 NOT NULL DEFAULT nextval('neuro_nid_seq'::regclass),
data jsonb,
CONSTRAINT neuro_pkey PRIMARY KEY (nid) NOT DEFERRABLE INITIALLY IMMEDIATE
);
与记录:
{"item2": {"1": "0", "uid": "0", "nota": "weqcqwe qwe wq", "fecha": "23-02-2015", "examen": "aesc", "puntaje": "0", "paciente": "103636426"}}
{"item2": {"1": "0", "uid": "0", "nota": "text", "fecha": "23-02-2015", "examen": "aesc", "puntaje": "0", "paciente": "103636426"}}
{"item3": {"1": "3", "2": "1", "3": "3", "uid": "0", "fecha": "23-02-2015", "examen": "fab", "puntaje": "7", "paciente": "103636426"}}
...
如何选择所有记录examen ='aesc'
?我尝试使用运算符->>
或@
. 如何以相同的方式选择某些字段?我需要在 JSON 列中维护初始的“itemX”。