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.
ID FRUIT 1 Apple 2 Orange 3 Apple 4 Pear 5 Apple 6 Pear 7 Pear
我想计算一张桌子上的每种水果。只有三个水果,我只需要总数。
我知道如何执行 SELECT COUNT(*) 但不是所有三合一查询
我想你想要这样的东西:
select fruit, count(id) from table group by fruit