alfieshooter1 Posted November 28, 2008 Share Posted November 28, 2008 I reckon this should be so easy, but I'm going round in circles fast. I have a table called fans: id, username, fanof, dateadded I want to return the most popular for a particular date, so I need to somehow select the 'fanof's added on that date and then sort them in order of how many 'fanof's there are. I.e 1, Bob, Sally, today 2, Bob, Jim, today 3, Bob, Bill, today 4, Bob, Sally, today 5, Bob, Bill, today 6, Bob, Bill, today Would return: Bill (most popular) Sally Jim Does that make ANY sense? Please help. Quote Link to comment Share on other sites More sharing options...
fenway Posted November 28, 2008 Share Posted November 28, 2008 You mean like select username, count(*) from fans where dateadded = <the-date-you-want> group by username ? Quote Link to comment Share on other sites More sharing options...
alfieshooter1 Posted November 28, 2008 Author Share Posted November 28, 2008 I BLOODY DO!!! Thanks so much! Alfie. Quote Link to comment 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.