Celcius Posted April 6, 2010 Share Posted April 6, 2010 I need to count the number of times each occurrence of a name appears in a column and then list the top three values SELECT name FROM Passengers ... LIMIT 0,3; Or something like that. Quote Link to comment https://forums.phpfreaks.com/topic/197716-count-the-number-of-times-a-name-appears-in-a-column/ Share on other sites More sharing options...
Celcius Posted April 6, 2010 Author Share Posted April 6, 2010 Sorry, I solved it. SELECT name, COUNT(name) FROM Passengers GROUP BY name ORDER BY COUNT(name) LIMIT 0,3; Quote Link to comment https://forums.phpfreaks.com/topic/197716-count-the-number-of-times-a-name-appears-in-a-column/#findComment-1037606 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.