Speaking strictly from a MySQL perspective --
First of all, I'm assuming you are calling rand() (lowercase).
Case isn't significant.
I don't really understand what you are trying to randomize in your
You should probably get the count of the records in your table and
generate a random number between 1 and that count. Then use offset to
? The syntax below works just fine to return a random instance of
I have a method that calls Model.find(:first, :order => "RAND()")
twice. I want it to return two different results but it always returns
the same thing twice.
What it *doesn't* do is guarantee that any two randomly selected
instances won't be the same
?> @up = UserProfile.find(:first, :order => "rand()")
If the two really need to be different, you'll have to address that with