[sqlite] Encryption

2016-11-11 Thread Richard Andersen
I'm using the ADO.NET version (System.Data.SQlite). I've created an RSA encrypted database using SQLite2009 and that is working fine, but I can't find any tools for editing the table in SQLite2009 once it's been created. Is it possible at all? In DB Browser for SQlite I can edit the table but

Re: [sqlite] Select older or not selected records

2016-11-11 Thread Simon Slavin
On 11 Nov 2016, at 12:59pm, Niall O'Reilly wrote: > IIUC, OP wishes to pick at random from the items which haven't yet been > used in the current cycle. That's different. To do that, you just need a flag 'seen' yes / no. When you enter a new quote set seen to 'no'.

Re: [sqlite] Select older or not selected records

2016-11-11 Thread Niall O'Reilly
On 11 Nov 2016, at 12:42, Simon Slavin wrote: No. When you use a quote you update the 'last used on' date for that table row. I think that's actually a "yes". IIUC, OP wishes to pick at random from the items which haven't yet been used in the current cycle. By simply using the 'last

Re: [sqlite] Select older or not selected records

2016-11-11 Thread Simon Slavin
On 11 Nov 2016, at 9:04am, Cecil Westerhof wrote: > Because you get always the same next quote after all quotes have been used. No. When you use a quote you update the 'last used on' date for that table row. Simon. ___

Re: [sqlite] Strange problem with using random with a table

2016-11-11 Thread Don V Nielsen
Does the same thing happen if you select from Psalms, or Thessalonians, instead of Proverbs? Sorry. Little religion humor. Too early in the morning and I haven't had my coffee, yet. On Fri, Nov 11, 2016 at 4:34 AM, Cecil Westerhof wrote: > 2016-11-11 11:22 GMT+01:00

Re: [sqlite] Select older or not selected records

2016-11-11 Thread Cecil Westerhof
2016-11-11 9:49 GMT+01:00 Rowan Worth : > ORDER BY > CASE timestamp > WHEN NULL THEN -9223372036854775808 > ELSE abs(random())*timestamp > END > LIMIT 5? > > Completely untested, and the weighting function (ELSE clause) is almost > certainly terrible :P I think the

Re: [sqlite] Strange problem with using random with a table

2016-11-11 Thread Cecil Westerhof
2016-11-11 11:22 GMT+01:00 Clemens Ladisch : > Cecil Westerhof wrote: >> When I execute the following query: >> SELECT *, randomiser * 1000 >> FROM (SELECT abs(random()) / 1 AS randomiser); >> >> I get normal results: >> 61|61000 >> >> But when I change it to:

Re: [sqlite] Strange problem with using random with a table

2016-11-11 Thread Cecil Westerhof
2016-11-11 11:01 GMT+01:00 Cecil Westerhof : > When I execute the following query: > SELECT * > , randomiser * 1000 > FROM ( > SELECT abs(random()) / 1 AS randomiser > ); > > I get normal results: > 61|61000 > > > But when I change it to: > SELECT *

Re: [sqlite] Strange problem with using random with a table

2016-11-11 Thread Clemens Ladisch
Cecil Westerhof wrote: > When I execute the following query: > SELECT *, randomiser * 1000 > FROM (SELECT abs(random()) / 1 AS randomiser); > > I get normal results: > 61|61000 > > But when I change it to: > SELECT *, randomiser * 1000 > FROM (SELECT abs(random()) /

[sqlite] Strange problem with using random with a table

2016-11-11 Thread Cecil Westerhof
When I execute the following query: SELECT * , randomiser * 1000 FROM ( SELECT abs(random()) / 1 AS randomiser ); I get normal results: 61|61000 But when I change it to: SELECT * , randomiser * 1000 FROM ( SELECT abs(random()) / 1 AS randomiser

Re: [sqlite] Select older or not selected records

2016-11-11 Thread Cecil Westerhof
2016-11-11 9:56 GMT+01:00 Simon Slavin : > >> I want to select several quotes, with the following constraints: >> - As long there are quotes that are not selected, no record that was >> already selected should be selected. >> - How longer ago a record was selected, the bigger

Re: [sqlite] Select older or not selected records

2016-11-11 Thread Simon Slavin
On 11 Nov 2016, at 8:26am, Cecil Westerhof wrote: > I want to select several quotes, with the following constraints: > - As long there are quotes that are not selected, no record that was > already selected should be selected. > - How longer ago a record was selected,

Re: [sqlite] Select older or not selected records

2016-11-11 Thread Cecil Westerhof
2016-11-11 9:49 GMT+01:00 Rowan Worth : > ORDER BY > CASE timestamp > WHEN NULL THEN -9223372036854775808 > ELSE abs(random())*timestamp > END > LIMIT 5? > > Completely untested, and the weighting function (ELSE clause) is almost > certainly terrible :P I think the

Re: [sqlite] Select older or not selected records

2016-11-11 Thread Rowan Worth
ORDER BY CASE timestamp WHEN NULL THEN -9223372036854775808 ELSE abs(random())*timestamp END LIMIT 5? Completely untested, and the weighting function (ELSE clause) is almost certainly terrible :P I think the approach is ok, though I remember some recent threads suggesting the

[sqlite] Select older or not selected records

2016-11-11 Thread Cecil Westerhof
I have an application that I want to migrate from file-based to sqlite. It displays random quotes. After selecting a quote I update the record with a timestamp. I want to select several quotes, with the following constraints: - As long there are quotes that are not selected, no record that was