Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个在运行的服务器上不起作用的简单查询MySql。我想要的只是返回一个人员列表以及他们出现在表格中的次数:
MySql
SELECT Person, Count(Person) as NoOfRecords FROM People;
这只返回一个记录,但有很多。我错过了什么?谢谢
添加一个GROUP BY子句
GROUP BY
SELECT Person, Count(Person) as NoOfRecords FROM People GROUP BY Person;