|
-
Jun 20th, 2004, 04:27 PM
#1
Take out a random record. [Resolved]
I have to take out 5 records from a MySQL table. First the 3 last one, and then 2 random records. But no one of them can be the same record. With my current skills I can see 2 methods to do it.
- I can store all the records that I have taken out, then use a while loop and take out a new random one untill I get a new one.
- I can use NOT LIKE (or what the syntax is again) and list up the first record that I have taken out the first time in the second one, and then the two first in the 3rd one, and the 3 first in the 4th one, and so on.
I can't see that any of them is a good solution. Maybe the second one is a bit faster, but that is all.
Is it a better way?
Last edited by NoteMe; Jun 21st, 2004 at 02:41 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|