I have a query, something like this:
..ORDER BY photo.sort_order DESC, profile.description DESC, RAND()
So, this means that first records with photos are displayed, and then those that have descriptions. Inside this, I want the order to be random (therefore, if there are ten entries with photos, they should always be on top, but ordered randomly)
The above does not work, and I know that rand () is not very efficient. What would be another simple solution?
source share