Problem
How to randomly extract 10 items from a database?
Workaround
There is no good solution, the efficiency is high, the method is simple.
Reference answer
If you have a cache system .... Load directly from the cache ....
Reference answer
No ~
Reference answer
Random syntax ...
Reference answer
Why not use the RAND function
Reference answer
Rand is definitely going to use it, but I don't know how to write this SQL statement.
Reference answer
SELECT ... From ... WHERE ... ORDER by RAND () LIMIT 10
Copy Code
Reference answer
Originally Posted by fising on 2009-1-4 11:54 [url=http://bbs.111cn.cn/redirect.php?goto=findpost&pid=814691&ptid=100356] Link marker [Img]http://bbs.111cn.cn/images/common/back.gif[/img][/url]
SELECT ... From ... WHERE ... ORDER by RAND () LIMIT 10
of learning
Reference answer
Thank you, I just wrote the same thing, but the prompt statement is wrong, does Rand have to capitalize? I was just a lowercase, wrong.
Reference answer
[url=http://www.linvo2008.cn/blog/?p=7] link marker Http://www.linvo2008.cn/blog/?p=7[/url]
http://www.bkjia.com/PHPjc/632599.html www.bkjia.com true http://www.bkjia.com/PHPjc/632599.html techarticle question How to randomly extract 10 of the contents of a database? The solution has no good solution, high efficiency, simple method. Refer to the answer if you have a cache system .... Directly from the slow ...