2

I have a simple query that doesn't work on the server running MySql. All I want is for it to return a list of people and the number of times they appear in the table:

SELECT Person, Count(Person) as NoOfRecords FROM People;

This only returns one record and yet there are many. What am I missing? Thanks

1 Answer 1

5

Add a GROUP BY clause

SELECT Person, Count(Person) as NoOfRecords FROM People GROUP BY Person;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.