I have a table which is a list of categories in an online directory.. each time the category is visited in increases the hits column by one..
I want to get the top 20 results (ie. the top twenty most popular categories) and then sort them into a list alphabetically.
I tihnk I have to use a nested select but when I do this I only get the top 20 results sorted by alphabet not by hits..
Here is the table structure:
Can anyone help with this?
TIA.
N.
Nematoth
I want to get the top 20 results (ie. the top twenty most popular categories) and then sort them into a list alphabetically.
I tihnk I have to use a nested select but when I do this I only get the top 20 results sorted by alphabet not by hits..
Here is the table structure:
Code:
#
# Table structure for table `category`
#
CREATE TABLE category (
autoID mediumint(9) NOT NULL auto_increment,
title varchar(100) NOT NULL default '',
hits int(11) NOT NULL default '0',
PRIMARY KEY (autoID)
) TYPE=MyISAM;
Can anyone help with this?
TIA.
N.
Nematoth