SELECT cat_name, SUM(amount) AS total_amount
FROM table
GROUP BY cat_name
More Related Contents:
- get first occurrence of last changed value of a column [closed]
- MySQL – Rows to Columns
- ROW_NUMBER() in MySQL
- multiple query same table but in different columns mysql
- How can I make SQL case sensitive string comparison on MySQL?
- 1052: Column ‘id’ in field list is ambiguous
- How can I temporarily disable a foreign key constraint in MySQL?
- How to do a batch insert in MySQL
- Count the occurrences of DISTINCT values
- Ordering by the order of values in a SQL IN() clause
- Creating a “Numbers Table” in MySQL
- SQL Selecting from two Tables with inner join and limit [duplicate]
- SQL: selecting rows where column value changed from previous row
- Why do results from a SQL query not come back in the order I expect?
- How to generate data in MySQL?
- MySQL combine two columns and add into a new column
- SQL query of multiple values in one cell
- How to skip certain database tables with mysqldump?
- MySQL error 1241: Operand should contain 1 column(s)
- How to set a MySQL row to READ-ONLY?
- How to transpose rows to columns with large amount of the data in BigQuery/SQL?
- Mysql: Order by like?
- Getting first day of the week in MySql using Week No
- Is there a way to get the row number in Mysql like the rownum in oracle [duplicate]
- How to format number with “.” as thousands separator and “,” as decimal separator?
- Using DISTINCT and COUNT together in a MySQL Query
- SQL date format convert? [dd.mm.yy to YYYY-MM-DD]
- INSERT INTO Table from multiple tables
- Execute INSERT if table is empty?
- Mysql How do you create a clustered index?