I know this way
but it looks to me that this is a little bit slow and the biger my table becomes the slower it will.
It's look inlogicle to first sort the hole table randomly and then select 5 entres, there shouth be a way to just get some random rows (if there is not - it's something to be done for the next version of the server
).
Isn't there a better way???
| Code: |
| SELECT column1,column2 FROM table ORDER BY RAND() LIMIT 5 |
but it looks to me that this is a little bit slow and the biger my table becomes the slower it will.
It's look inlogicle to first sort the hole table randomly and then select 5 entres, there shouth be a way to just get some random rows (if there is not - it's something to be done for the next version of the server
