0
'SELECT `from`, `to`, count(*) AS num_clicks
FROM my_rank
WHERE my_rank_data
BETWEEN "'.$yesterday.'" AND "'.$today.'"
ORDER BY num_clicks DESC LIMIT 0,20';
Above I am trying to take the fields "from" and "to" of a table, but I only want the lines of the last 24 hours, and I need to return only the 20 lines that most repeat of these 24 hours. However the above result returns me lines that are not the ones that are most repeated in the given date range.
The lines that repeat the most are the ones that have the most
num_clicks
?– fernandoandrade
I’m not sure, I think I did it wrong this "Count(*) AS num_clicks". My intention was that it was this "num_clicks", and being, what do I do with it? I will only have the number of times it repeats, I need the line that repeats most. I would use an ORDER BY num_clicks DESC?
– PerduGames