Take it easy Jay, being a little sensitive aren't we. I'm merely pointing you to the "trivia" within the SQLite package that actually solves the problem - as it states in the SQLite doco, the source code is a major part of the documentation. So, if you don't look at the source code you're going to miss a lot of this "trivia" - again, if you did, then you'd notice that for regression testing, a flag is set that forces the random() function to be seeded on the same number each time.
Steve -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg] On Behalf Of Jay Sprenkle Sent: 17 January 2006 15:54 To: [email protected] Subject: Re: [sqlite] RE: [RBL] Re: [sqlite] Randomly ordering results On 1/17/06, Steve O'Hara <[EMAIL PROTECTED]> wrote: > Jay, If you're going to offer advice, at least do some basic research to > make sure it's accurate. Was it your intent to be insulting or are you just drunk? > > Firstly, having a column that has a random number in it and sorting by > it produces the same output each time you query on it - obviously > unsatisfactory and I would have thought, manor from heaven for card > counters everywhere!! If you don't reset the column to new random values on subsequent sorts you're correct. I thought that obvious enough it didn't need comment. In any case, he didn't specify that he needed to do this repeatedly for his application. In an online exam I would doubt they present the questions twice. > > Secondly, the standard SQLite function random() is actually seeded by > the current time and date every time you open a database. Thanks for that useful bit of trivia. Automatically seeding the random function is a bad idea and I'm surprised an otherwise well thought out package does it. It makes regression testing of the engine and your programs very difficult. Further, you assume that he's using the sqlite random function and not the function from whatever language he's using. My response was intended to explain the concept of the algorithm not present a concrete solution. The algorithm was what he asked about. If you had something positive to add perhaps you should have written something positive to the original poster instead of insulting asides to others.

