How to display content in a random order?

Friends, Hello!
Tell me how to display content in a random order? the listing below:
$query->order($db->quoteName('a.featured') . 'DESC')->order($db->quoteName('a.publish_up') . 'DESC');
June 26th 19 at 14:23
3 answers
June 26th 19 at 14:25
Solution
I think I got it:
$query->order('a.featured DESC,' . $query->rand());
Of course, not praise himself .... ))) - lily.Kozey commented on June 26th 19 at 14:28
: ))))))))) - clifton.Tromp90 commented on June 26th 19 at 14:31
June 26th 19 at 14:27
well, take sorting. Will be in the order of records in the table.
There is a caveat, I have only chosen to mix up. - lily.Kozey commented on June 26th 19 at 14:30
June 26th 19 at 14:29
ORDER BY RAND () is not the fastest operation, however, if the query will be executed often, it can be accelerated
About RAND heard but don't know how to embed in its structure. - lily.Kozey commented on June 26th 19 at 14:32

Find more questions by tags MySQLJoomla