Page 1 of 1

TOP 5

Posted: Sun Oct 09, 2005 3:52 pm
by vchris
I want to display the 5 records with the highest "clickcount" value.

I want to display the 5 most recent records. I have a "dateadded" field.

Posted: Sun Oct 09, 2005 4:00 pm
by feyd
have a look into the ORDER BY clause

Posted: Sun Oct 09, 2005 4:13 pm
by vchris
I know there was a TOP function in SQL but I don't know if it still works with MySQL.

I've tried to search for it but got nothing on the mysql site. I'd rather have the query only get 5 records instead of all.

Posted: Sun Oct 09, 2005 4:26 pm
by shoebappa
Add LIMIT to feyd's recommendation.

Posted: Sun Oct 09, 2005 4:35 pm
by vchris
Thanks works perfectly! :D