 
 
 --
+-- Name: egauge_energy_autoload_dates; Type: VIEW; Schema: public; Owner: postgres
+--
+
+CREATE VIEW egauge_energy_autoload_dates AS
+    SELECT "EgaugeEnergyAutoload".egauge_id, min("EgaugeEnergyAutoload".datetime) AS "E Start Date", max("EgaugeEnergyAutoload".datetime) AS "E Latest Date", ((count(*) / 60) / 24) AS "Days of Data" FROM "EgaugeEnergyAutoload" GROUP BY "EgaugeEnergyAutoload".egauge_id ORDER BY "EgaugeEnergyAutoload".egauge_id;
+
+
+ALTER TABLE public.egauge_energy_autoload_dates OWNER TO postgres;
+
+--
+-- Name: VIEW egauge_energy_autoload_dates; Type: COMMENT; Schema: public; Owner: postgres
+--
+
+COMMENT ON VIEW egauge_energy_autoload_dates IS 'Used by the MSG eGauge Service. @author Daniel Zhang (張道博)';
+
+
+--
 -- Name: event_data_id_seq; Type: SEQUENCE; Schema: public; Owner: sepgroup
 --
 

    solarpump_kw double precision,
    upload_date timestamp(6) without time zone,
    microwave_kw double precision,
    acplus_kw double precision
);



-- Name: idx_primary_key; Type: INDEX; Schema: public; Owner: sepgroup; Tablespace: 
--

CREATE INDEX idx_primary_key ON "EgaugeEnergyAutoload" USING btree (egauge_id, datetime);


--
