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.
我有一张表,其中包括以下字段: country, price and units 我试图用它SELECT COUNT(*)来获取每个国家/地区的总和,售出多少单位。 MySQL 的正确说法是什么?
country, price and units
SELECT COUNT(*)
SELECT country, SUM(units) FROM mytable GROUP BY country