The results are properly selected using the ORDER BY CASE from my query. I want to randomize the results of each case. That is, according to the command when apple (random) 1 then when the pear (random) then 2, etc.
So my results are still ordered by each case, but in the results they are random per case, every time the question
You can try ORDER BY CASE, RAND ()
. RAND ()
generates a random number, of course.
However, I have heard that the method of shuffling elements in SQL is not the most effective and it is better to randomize the elements in PHP. But disorganizing them per case is not a trivial task. ()
Comments
Post a Comment