Re: [sqlite] Need two ORDER two times when using RANDOM

2018-03-11 Thread R Smith
There is nothing "stable" about the randomizer (at least not if it does its work well). In your queries you are simply seeing 2 different orderings with the values accompanying the "randomized" order being linked to two different random sets. To put it another way, the "last" order-by is not

[sqlite] Need two ORDER two times when using RANDOM

2018-03-10 Thread Cecil Westerhof
I have the following query: SELECT * , randomiser , randomiser FROM ( SELECT * , ABS(RANDOM()) / 5E17 AS randomiser FROM proverbs WHERE used <> 'notUsed' ORDER BY randomiser + IFNULL(JULIANDAY(used), 0) ASC ) ORDER BY randomiser + IFNULL(JULIANDAY(used), 0)