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.
我有一个对象和颜色列表;每个物体都有颜色。我想创建一个查询来计算每种颜色有多少个对象。
我应该使用什么功能?
你可能会写一个这样的查询:
SELECT COUNT(color) AS cnt, color FROM YourTable GROUP BY color
SELECT Color, Count(Objects) FROM myTable GROUP BY Color