MySQL的SUM组

我有类似的表格

(cat_name,amount);

如何获得每个cat_name的总和由cat_name分组

 SELECT cat_name, SUM(amount) AS total_amount FROM table GROUP BY cat_name 
 SELECT cat_name, SUM(amount) AS TotalAmount FROM Table GROUP BY cat_name