Tom
Tom

Reputation: 147

Randomize x through y rows in a MYSQL database

For example, how can I randomize rows ten through 20? I only know how to randomize all rows using RANDR(). I am using PHP + MYSQLi. Can someone explain me using MYSQL RANDR() ? I know it's not efficient.

Thanks, Tom.

Upvotes: 0

Views: 70

Answers (1)

Thomas McNamee
Thomas McNamee

Reputation: 712

I have used a technique with SQL Server that might port to MYSQL. I assign a new GUID to each row, then sort on that.

Upvotes: 1

Related Questions