billgod Posted January 21, 2009 Share Posted January 21, 2009 If I have a table with a column that can have duplicate records. I need to look at that table and show the record that returns the most records. I hope that makes sense. If not here is a little example. Table has a persons name entered for every time they pick their nose. I need to pull who picks their nose the most. Thanks Bill Link to comment https://forums.phpfreaks.com/topic/141863-solved-need-to-select-where-x-most-returns/ Share on other sites More sharing options...
kkubek Posted January 22, 2009 Share Posted January 22, 2009 select count(*) as namecount, column_name_with_name from tab group by column_name_with_name order by namecount Link to comment https://forums.phpfreaks.com/topic/141863-solved-need-to-select-where-x-most-returns/#findComment-742798 Share on other sites More sharing options...
billgod Posted January 22, 2009 Author Share Posted January 22, 2009 thats what I needed.. Thanks Link to comment https://forums.phpfreaks.com/topic/141863-solved-need-to-select-where-x-most-returns/#findComment-742810 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.