Selecting a random result from Simple Database (SDB) on AWS

amazon-simpledb

Anyone know how to do this – just what would be the equivalent to this:
"select * from YOUR_TABLE order by rand() limit 1"
in mysql??

Maybe not possible in SDB?

Best Answer

I actually talked to an Amazon rep about this. What you're supposed to do is store a random value along with your data in SDB. When you want a row back, you generate another random value and pick the first result less than that. So you need to store a little more data, but it only takes one query.

Related Topic