Re: Fwd: inserting new data only
Przemek Klosowski <[email protected]> Tue, 25 Feb 2020 13:14:55 -0500
| Newsgroups | gmane.comp.db.sqlite.general |
|---|---|
| Message-ID | <CAC=1GgFESZCrf5O2v3efZQXDBzR_YSBpzAkpEgobNc516ZmayQ@mail.gmail.com> |
On Tue, Feb 25, 2020 at 1:03 PM John McKown <[email protected]> wrote: > > I am storing time series data arriving from a sensor into (time,value) > > records, like so: > > 10:32 12 > > 10:35 15 > > 10:37 15 > > 10:39 13 > > 10:43 13 > > 10:46 18 > > > > and I want to avoid storing repetitive data, so that the database should > > contain > > 10:32 12 > > 10:35 15 > > 10:39 13 > > 10:46 18 > > where only the earliest time with the unchanging value is stored. ... > Why not: > > CREATE TABLE ME (ATIME TIME, VALUE INTEGER PRIMARY KEY); > > You can't INSERT duplicate numbers into the "VALUE" column, it will fail. This won't work here because the same value COULD reappear later: 12 15 15 13 13 18 15 needs to be registered as 12 15 13 18 15 _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users