Page 1 of 1

Slect 1000 rows but only show random 100?

Posted: Fri Oct 17, 2008 5:00 am
by alex.barylski
Is it possible?

I am implementing a tag coud...I have 2000 records alphabetically sorted (and various other ways) but I only want to show 10 or 100 at a time. Obviously using a LIMIT will not work cause I want the output to be random, not alphabetically ordered.

Ideally there is a random aggregate function or something which can jumble my results and I can thus use LIMIT to display only a few.

Make sense? Possible?

Re: Slect 1000 rows but only show random 100?

Posted: Fri Oct 17, 2008 5:13 am
by VladSun
[sql]SELECT     *FROM     mytableORDER BY    rand()LIMIT     100[/sql]

Re: Slect 1000 rows but only show random 100?

Posted: Sat Oct 18, 2008 5:35 am
by alex.barylski
How did I miss that :oops: :lol:

Thanks again :)