How To Get SELECT from this table???

admin

Administrator
Staff member
I have a table where all the searches are beeing stored... but now how to get statistics from this table....
Table looks like this:

create table statistic_search (
stat_id INT NOT NULL AUTO_INCREMENT,
stat_hash VARCHAR (32) NOT NULL,
stat_keyword VARCHAR (255) NOT NULL,
stat_ip VARCHAR (16) NOT NULL,
stat_date DATETIME NOT NULL,
PRIMARY KEY (stat_id)
);

How to get for example ALL or 10 most searchable (with the highest count(*) ) keywords.. keywords are beeing stored in stat_keyword...
for example we have 10 records with stat_keyword = "product", 5 with "firm", and 1 with "mp3".
How to get as a result (may be not exactly from SELECT but after some functions or sth) sth like this...

product 10
firm 5
mp3 1


THX
 
Back
Top