Suppose I have a column with words:
orange
grape
orange
orange
apple
orange
grape
banana
How do I execute a query to get the top 10 words, as well as their count?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
GROUP BYgroups by values ofword, theORDER BY COUNT(*) DESCgets you the rows with highest count first, and theLIMIT 10returns the first 10 rows only.