Dejan Lekic wrote:
>
> Hi to all
>
> Is there easy way to get RANDOM raw from some table?
>
> Dejan
>
>
There are many rather easy ways, here is one:
select count(*)
rememeber the number of rows (n)
pick a random number between 1 and n (r) ( in C you will say r = 1 +
rand() % n; )
select * from tbname limit $r, 1
but WHY? Databases are there to create order :-)
--
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)
| Thread |
|---|
| • RANDOM RAW | Dejan Lekic | 16 Jun |
| • Re: RANDOM RAW | Sasha Pachev | 16 Jun |