James K. Lowden, on Wednesday, February 26, 2020 11:55 AM, wrote...
>
> On Tue, 25 Feb 2020 12:02:24 -0500
> Przemek Klosowski wrote:
>
> > 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
On Wed, Feb 26, 2020 at 11:56 AM James K. Lowden
wrote:
> > and I want to avoid storing repetitive data, so that the database
> > should contain
> > [...]
> > only the earliest time with the unchanging value is stored.
>
> Be careful what you wish for. Usually "avoid storing" is a proxy for
>
On Tue, 25 Feb 2020 12:02:24 -0500
Przemek Klosowski wrote:
> 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.
Be careful what you wish for.
>From: sqlite-users On
>Behalf Of Keith Medcalf
>Sent: Tuesday, 25 February, 2020 14:44
>To: SQLite mailing list
>Subject: Re: [sqlite] Fwd: inserting new data only
>
>
>If you are going to do it in all in one insert statement rather than
>using a before trigge
t;Subject: Re: [sqlite] Fwd: inserting new data only
>
>
>On Tuesday, 25 February, 2020 12:23, Przemek Klosowski
> wrote:
>
>>On Tue, Feb 25, 2020 at 1:18 PM Keith Medcalf
>wrote:
>
>>> create table data
>>> (
>>> keytext primary key,
>
On Tuesday, 25 February, 2020 12:23, Przemek Klosowski
wrote:
>On Tue, Feb 25, 2020 at 1:18 PM Keith Medcalf wrote:
>> create table data
>> (
>> keytext primary key,
>> data integer not null
>> )
>> without rowid;
>>
>> -- insert into data select ?, ? as value where value IS
Awesome---exactly what's needed.
The monotonicity of the time key variable is assured by how the data
is collected---but is there a way to express that in sqlite?
create table data (
key text primary key check
(julianday(key) > julianday(select max(key) from data),
data integer not null);
On Tue, Feb 25, 2020 at 1:18 PM Keith Medcalf wrote:
> create table data
> (
> keytext primary key,
> data integer not null
> )
> without rowid;
>
> -- insert into data select (?, ? as value where value IS NOT (select data
> from (select max(key), data from data));
>..
>
Keith Medcalf
>Sent: Tuesday, 25 February, 2020 11:18
>To: 'SQLite mailing list'
>Subject: RE: [sqlite] Fwd: inserting new data only
>
>
>create table data
>(
>keytext primary key,
>data integer not null
>)
>without rowid;
>
>-- inser
e's a Highway to Hell but only a Stairway to Heaven says a
lot about anticipated traffic volume.
>-Original Message-
>From: sqlite-users On
>Behalf Of Przemek Klosowski
>Sent: Tuesday, 25 February, 2020 10:02
>To: SQLite mailing list
>Subject: [sqlite] Fwd: inserting new data
On Tue, Feb 25, 2020 at 1:03 PM John McKown
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
rigger can't prevent the subsequent insert.
>
>
> -Original Message-
> From: sqlite-users On Behalf
> Of Przemek Klosowski
> Sent: Tuesday, February 25, 2020 12:02 PM
> To: SQLite mailing list
> Subject: [sqlite] Fwd: inserting new data only
>
> I am storing time serie
On Tue, Feb 25, 2020 at 11:03 AM Przemek Klosowski <
przemek.klosowski+sql...@gmail.com> 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
to let you know what happened you
could make it
select raise(abort, 'Repeated entry');
-Original Message-
From: sqlite-users On Behalf Of
Przemek Klosowski
Sent: Tuesday, February 25, 2020 12:02 PM
To: SQLite mailing list
Subject: [sqlite] Fwd: inserting new data only
I am storing time
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
15 matches
Mail list logo