I have a database table that contains a column that records page hits for each record.
I want to select the 5 most popular pages from the database, but I can not find a suitable method for this, using only SQL. In particular, I am looking for one that does not include selecting each record and scanning through it using PHP.
What is the best way to do this through SQL (if any)?
Thank.
source
share