How to randomly select within a column category in MySQL -


How do you select a fixed number of column cost per line?

For example, I have a MySQL database of forums, for example, I have a MySQL database of a forum, where the column has the thread ID, Answer ID (the answer to the post that started the thread ) And poster IDs I randomly want to start 4 threads from each poster.

You might have the name of the table "threads", maybe something like this should be done

< Blockquote>

SELECT * RAND by thread order (LIMIT 4;

I do not know how efficient it is, but possibly not recommended with a bigger table. Perhaps generating random numbers in PHP or other languages ​​is a better option.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Algorithm negotiation fail SSH in Jenkins -

java - Messages from .properties file do not display UTF-8 characters -