Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Re: Is there a good way of retrieving entries randomly from a database (MySQL perhaps)?

by sgifford (Prior)
on Jan 04, 2004 at 09:53 UTC ( [id://318645]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Is there a good way of retrieving entries randomly from a database (MySQL perhaps)?
in thread Is there a good way of retrieving entries randomly from a database (MySQL perhaps)?

MySQL may repeat results if you do repeated queries with ORDER BY rand LIMIT 1. But it won't if you ask for all 10 questions at once---ORDER BY rand LIMIT 10.

You may have to issue one query per subject, but so what? Unless there are dozens of subjects, the speed difference won't be noticeable.

  • Comment on Re: Re: Re: Is there a good way of retrieving entries randomly from a database (MySQL perhaps)?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://318645]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-23 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found