There is a table, and there are such columns in it:
price | trade_point_id | date 100 | 1 | 2019-01-01 112 | 1 | 2019-01-01 231 | 2 | 2019-01-02 180 | 2 | 2019-01-02 300 | 3 | 2019-01-03 10 | 3 | 2019-01-03 180 | 1 | 2019-01-04 800 | 1 | 2019-01-04 I need to calculate the amount in the price column. So that those values which have identical trade_point_id and date were summed up.
That is, the result table should be:
sum | trade_point_id | date 210 | 1 | 2019-01-01 411 | 2 | 2019-01-02 310 | 3 | 2019-01-03 980 | 1 | 2019-01-04 I do not understand what to write in WHERE.
GROUP BY.SELECT SUM(price), trade_point_id, date FROM ТАБЛИЦА GROUP BY trade_point_id, date. in general, all aggregation functions requireGROUP BY- Total Pusherpurchase.price),purchase.trade_point_id,purchase.dateFROMpurchaseGROUP BYpurchase.date,purchase.trade_point_id; Thank! - Svetlana