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.
我有一个 SQL 格式的表,有 3 列和 1000 行,如下所示:
Name Age Nick 20 Msh 23 Kij 19 jkh 20 kjh 22 cbc 23 iuy 27 jhjh 19
我想看看哪些名字是同龄的,有几个?
这更像是一个 SQL 问题而不是 python 问题。
您必须使用聚合函数(计数)
试试这个查询:
select name, count(*) as age from table group by age;