On Fri, Jan 22, 2016 at 12:22 PM, Stephan Beal
wrote:
>
>
> On Fri, Jan 22, 2016 at 12:11 PM, Bart Smissaert > wrote:
>
>> Say I want 1 random numbers between 100 and 1000 how can I do that
>> without
>> selecting from a table?
>> I know I can do:
>> select abs(random() %(1000 - 100)) + 100
Thanks, will look at that as well.
I was thinking achieving this with a user function,
maybe using sqlite3_randomness, but I this looks very good.
RBS
On Fri, Jan 22, 2016 at 12:39 PM, Stephan Beal
wrote:
> On Fri, Jan 22, 2016 at 12:22 PM, Stephan Beal
> wrote:
>
> >
> >
> > On Fri, Jan 22,
Thanks, that works very well and is a lot faster than involving a table.
I don't need the x output, so I have done:
with conf(max) as
(select 1), rnd(n, x) as
(select abs(random() %(1000 - 100)) + 100, 1 union all
select abs(random() %(1000 - 100)) + 100, x + 1
from rnd where x < (select max
On Fri, Jan 22, 2016 at 12:11 PM, Bart Smissaert
wrote:
> Say I want 1 random numbers between 100 and 1000 how can I do that
> without
> selecting from a table?
> I know I can do:
> select abs(random() %(1000 - 100)) + 100 as rnd from TableWith1Rows
> but there must be a better way.
>
>
Say I want 1 random numbers between 100 and 1000 how can I do that
without
selecting from a table?
I know I can do:
select abs(random() %(1000 - 100)) + 100 as rnd from TableWith1Rows
but there must be a better way.
RBS
5 matches
Mail list logo