使用Postgres 9.6。 我有這個工作,但懷疑有一個更有效的方法。在MyEventLength陣列上計算AVG,SUM等的最佳方法是什麼? DROP TABLE IF EXISTS activity;
DROP SEQUENCE IF EXISTS activity_id_seq;
CREATE SEQUENCE activity_id_seq;
CREATE TABLE activ
我有一個表: CREATE TABLE inbound (-- broadcasts received from RTs
id SERIAL primary key,
ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
rt VARCHAR(10) NOT NULL,
region region NOT N