Re: [sqlite] Automatic numbering

2018-07-07 Thread Cecil Westerhof
2018-07-07 14:57 GMT+02:00 Simon Slavin : > On 7 Jul 2018, at 12:04pm, Cecil Westerhof wrote: > > > ​I went for the following solution: > >UPDATE > ​​ > ​​ > selectRandom > >SETlastUsed= DATE('now', 'localtime') > >, lastUsedIdx = ( > >SELECT

Re: [sqlite] Automatic numbering

2018-07-07 Thread Simon Slavin
On 7 Jul 2018, at 12:04pm, Cecil Westerhof wrote: > ​I went for the following solution: >UPDATE selectRandom >SETlastUsed= DATE('now', 'localtime') >, lastUsedIdx = ( >SELECT IFNULL(MAX(lastUsedIdx), 0) >FROM selectRandom >WHERE lastUsed =

Re: [sqlite] Automatic numbering

2018-07-07 Thread Cecil Westerhof
2018-07-05 5:37 GMT+02:00 Simon Slavin : > On 5 Jul 2018, at 3:22am, Cecil Westerhof wrote: > > > I only want to store a date with a record. But it is possible that more > as > > one record will be inserted, so I want to use another field to use as an > > index. So that the first gets an one,

Re: [sqlite] Automatic numbering

2018-07-05 Thread David Raymond
Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Cecil Westerhof Sent: Thursday, July 05, 2018 12:00 AM To: SQLite mailing list Subject: Re: [sqlite] Automatic numbering 2018-07-05 5:37 GMT+02:00 Simon Slavin : > On 5 Jul 2018,

Re: [sqlite] Automatic numbering

2018-07-04 Thread Cecil Westerhof
2018-07-05 5:37 GMT+02:00 Simon Slavin : > On 5 Jul 2018, at 3:22am, Cecil Westerhof wrote: > > > I only want to store a date with a record. But it is possible that more > as > > one record will be inserted, so I want to use another field to use as an > > index. So that the first gets an one,

Re: [sqlite] Automatic numbering

2018-07-04 Thread Simon Slavin
On 5 Jul 2018, at 3:22am, Cecil Westerhof wrote: > I only want to store a date with a record. But it is possible that more as > one record will be inserted, so I want to use another field to use as an > index. So that the first gets an one, the second a two, etc. > Is this possible, or do I just