iSebbeYT
iSebbeYT

Reputation: 1521

SQL Query SELECT table that sum all values where two others are equal

I have the following table ("Have"). What would be a proper way to SELECT a table where you sum the value of C where A and B are equal. So that you get the result displayed in "Want".

enter image description here

Upvotes: 0

Views: 36

Answers (1)

Sphinx
Sphinx

Reputation: 10729

use group by then sum.

select A, B, sum(c) from your_table group by A, B

Upvotes: 3

Related Questions