I have this table:|    A    |  B  ||---------|-----|| grocery | $10 || clothes | $40 || grocery | $19 |etc.So I'd like to have a column with an aggregation of the categories like grocery and clothes with the total expenses, what in SQL would be a JOIN with the aggregate function SUM()How can I achieve this?
How to do a Google Spreadsheet equivalent to SQL's JOIN and SUM( )?
google spreadsheets
This is what I think you're looking for:Formula=QUERY(DATA!B1:C3;SELECT B, SUM(C) GROUP BY B label B 'Type', SUM(C) 'Sum')ExplainedColumn C is aggregated by column B through a summation. Labels are added. In this particular case, the usage of JOIN in an SQL statement isn't applicable, since the aggregation is done on one table.  ScreenshotsData:ResultExampleI've created an example file for you: Sum Aggregate