2016-11-11 9:56 GMT+01:00 Simon Slavin <[email protected]>: > >> 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 the chance should >> be that it is selected. >> >> What would the best way to do this? > > Get rid of the first requirement by choosing an appropriate 'startup' > last-seen-timestamp for existing quotes. Then you don't have to include the > logic for selecting by it in your software.
The idea of Rowan works. Needs some fine-tuning, but that is not a problem. > Logically speaking this should be a very early date. Perhaps 10 years before > the day the quote was added. That would simulate the quote not having been > seen for 10 years. > > As for selecting a quote, why not just select the quote with the earliest > last-seen-timestamp ? It can be done in one SELECT operation which uses an > index, so it'll happen almost instantly. Because you get always the same next quote after all quotes have been used. -- Cecil Westerhof _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

