I have a SQL table like this
id | date | number | type |
---|---|---|---|
1 | 2022-02-02 | 1 | DC |
2 | 2022-02-03 | 20 | DC |
3 | 2022-02-03 | 9 | DC |
4 | 2022-03-04 | 2 | KF |
I want to sum number column with condition "type" = "DC" and last row per date.
I should get result 10 (9+1) because on date 2022-02-03 have 2 row, the last row will taken (9)