I created a SELECT
and I want to 'SUM' different rows if the NIF are equal to an other nif and the contract are the same to other and the product is 100
SELECT
NIF,
CONTRACT,
PRODUCT,
SUM(SALDO) when PRODUCT=100
DATE
from TABLE_AAA
And then I would like to convert as a chart.
NIF CONTRACT PRODUCT SALDO DATE
1 1001 100 1 27/04/2016
1 1001 100 1 27/04/2016
1 1003 100 2 27/04/2016
1 1003 100 2 27/04/2016
1 1001 102 1 27/04/2016
2 1001 200 5 27/04/2016
2 1001 200 1 27/04/2016
NIF CONTRACT PRODUCT SALDO DATE
1 1001 100 2 27/04/2016
1 1003 100 4 27/04/2016
1 1001 102 1 27/04/2016
2 1001 200 5 27/04/2016
2 1001 200 1 27/04/2016