son.of.the.morning Posted December 9, 2011 Share Posted December 9, 2011 I want to query the five heighest values in a coloum but the coloum is not the primarykey. i.e: i have a coloum on the end of my table (articles) called views which get updated when ever an article is viewed by adding 1. On anther page i want to be able to view the 5 most viewed articles. Quote Link to comment https://forums.phpfreaks.com/topic/252813-selecting-the-records-by-the-heighest-values/ Share on other sites More sharing options...
trq Posted December 9, 2011 Share Posted December 9, 2011 SELECT article FROM articles ORDER BY somecolumn DESC LIMIT 5; Quote Link to comment https://forums.phpfreaks.com/topic/252813-selecting-the-records-by-the-heighest-values/#findComment-1296137 Share on other sites More sharing options...
son.of.the.morning Posted December 9, 2011 Author Share Posted December 9, 2011 Thanks man. Silly question i guess just wanted to make sure. Quote Link to comment https://forums.phpfreaks.com/topic/252813-selecting-the-records-by-the-heighest-values/#findComment-1296138 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.