我有表“event_statistics”,其定义如下:
\n\nCREATE TABLE public.event_statistics (\n id int4 NOT NULL DEFAULT nextval(\'event_statistics_id_seq\'::regclass),\n client_id int4 NULL,\n session_id int4 NULL,\n action_name text NULL,\n value text NULL,\n product_id int8 NULL,\n product_options jsonb NOT NULL DEFAULT \'{}\'::jsonb,\n url text NULL,\n url_options jsonb NOT NULL DEFAULT \'{}\'::jsonb,\n visit int4 NULL DEFAULT 0,\n date_update timestamptz NULL,\nCONSTRAINT event_statistics_pkey PRIMARY KEY (id),\nCONSTRAINT event_statistics_client_id_session_id_sessions_client_id_id_for \nFOREIGN KEY \n(client_id,session_id) REFERENCES <?>() ON DELETE CASCADE ON UPDATE CASCADE\n)\nWITH (\n OIDS=FALSE\n) ;\nCREATE INDEX regdate ON public.event_statistics (date_update \ntimestamptz_ops) ;\nRun Code Online (Sandbox Code Playgroud)\n\n和表“客户”: …