Re: [sqlite] order by "a huge number" does not work, but "random" well why ?

2013-01-15 Thread Simon Slavin
On 15 Jan 2013, at 1:58pm, Ryan Johnson wrote: > On 14/01/2013 9:48 AM, François-xavier Jacobs wrote: >> i would like to "seed random" a request, so i could do use some pagination >> system with a order by random(), is this possible sqlite ? when a tried to >> use

Re: [sqlite] order by "a huge number" does not work, but "random" well why ?

2013-01-15 Thread François-xavier Jacobs
Indeed shuffle was my goal i solve it by doing order by "((rowid * "+seed.longValue()+" ) % "+BIG_PRIME_NUMBER+")"; as long ass the seed doe not change result is the same, so i can shuffle with LIMT Regards 2013/1/15 Ryan Johnson > On 14/01/2013 9:48 AM,

Re: [sqlite] order by "a huge number" does not work, but "random" well why ?

2013-01-15 Thread Clemens Ladisch
François-xavier Jacobs wrote: > when a tried to use "order by 1234567892" it always return the same order Because this is the *same* value for all records. > i would like to "seed random" a request, so i could do use some pagination > system with a order by random(), is this possible sqlite ?

Re: [sqlite] order by "a huge number" does not work, but "random" well why ?

2013-01-15 Thread Igor Tandetnik
On 1/14/2013 9:48 AM, François-xavier Jacobs wrote: i would like to "seed random" a request, so i could do use some pagination system with a order by random(), is this possible sqlite ? when a tried to use "order by 1234567892" it always return the same order random() returns a different value

Re: [sqlite] order by "a huge number" does not work, but "random" well why ?

2013-01-15 Thread Marc L. Allen
If you literally used "ORDER BY 1234567892" then there's nothing in the record being sorted. I can't recall is SQLite allows order by aliases, but something like.. Select ..., random() as X Order by X Might work, as long as random() is executed for each row. (Sorry.. don't have a quick SQLite

Re: [sqlite] order by "a huge number" does not work, but "random" well why ?

2013-01-15 Thread Ryan Johnson
On 14/01/2013 9:48 AM, François-xavier Jacobs wrote: Hi everyone i would like to "seed random" a request, so i could do use some pagination system with a order by random(), is this possible sqlite ? when a tried to use "order by 1234567892" it always return the same order That's because you