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 Quote 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 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.