Update query to only put new samples in

This commit is contained in:
Ryan Voots 2025-05-09 16:06:05 -04:00
parent 9329f1e992
commit d83bb3b58c

View file

@ -1,3 +1,10 @@
INSERT INTO public."glucose-import"
(SELECT nextval('glucose-import_id_seq'), "glucose"."deviceSerialNumber", "glucose"."deviceType", units, value, time FROM influx.glucose);
(SELECT nextval('glucose-import_id_seq'),
"glucose"."deviceSerialNumber",
"glucose"."deviceType",
"glucose".units,
"glucose".value,
"glucose".time
FROM influx.glucose
WHERE "glucose".time >= (SELECT max(time) FROM public."glucose-import")
);