I really hope someone can help me here. I am currently coding in classic asp, and I work with an SQL Database.
We have a support page that logs all visits using their network login id into an sql table. And this is where I am having an issue.
I need to display the top 10 highest visitors of the page and the top 10 lowest used visitors. So for instance, if you see below, this is similar to how I want to see the data on the page:
Sorry, MS-SQL not MySQL
I think you have to group the Names and Count them after that. Select the Top 10 ordered by Count DESC and ASC.
SELECT TOP 10 Table1.Visitor, Count(Table1.Visitor) AS Visits
FROM Table1
GROUP BY Table1.Visitor
ORDER BY Count(Table1.Visitor) DESC;
UPDATE 1
MySQL uses LIMIT instead of TOP (@w3schools):
SELECT Table1.Visitor, Count(Table1.Visitor) AS Visits
FROM Table1
GROUP BY Table1.Visitor
ORDER BY Count(Table1.Visitor) DESC;
LIMIT 10;