RE: How to structure a random query

2001-04-18 Thread Braxton Robbason
http://www.mysql.com/doc/M/a/Mathematical_functions.html describes how to do this using the RAND() function. -Original Message- From: Alec Smith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 6:27 PM To: [EMAIL PROTECTED] Subject: How to structure a random query I'm just

Re: How to structure a random query

2001-04-18 Thread Philip Mak
On Wed, 18 Apr 2001, Alec Smith wrote: I've got a table of X rows, each with a unique ID as determined by auto_increment when the row is inserted into the database. How would I go about doing a SELECT on a row of the database and have MySQL return a row at random? Maybe you can do something

Re: How to structure a random query

2001-04-18 Thread Ben Dimmock
You could also do something like: select field1, field2 from table order by rand() limit 1; HTH Ben - Original Message - From: "Philip Mak" [EMAIL PROTECTED] To: "Alec Smith" [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 11:50 PM Subject: