Just got a quick question, this is a simple thing to do via PHP but I’m pretty sure there has to be a way to do it via MySQL.
I’ve got a table with the columns id, element_id, video_link, views among a few others.
What I want to do select one out of the top 5 most viewed videos at random.
E.g
SELECT *
FROM table_name
WHERE "In human terms order by views descending and then select 1 of the top 5 at random"
It’s really simple to do via PHP and I will use that if there isn’t a way to do it via MySQL but it would be nice to know!
1 Answer