I have a table that is basically a ledger with id_numbers and corresponding "reward" transaction values... I want to sum the transaction values by id_number...
I tried:
SELECT DISTINCT `id_no` , SUM( `reward` ) AS BALANCE
FROM `test_ledger`
GROUP BY `id_no`
But it is not returning the expected result...
id_no is varchar and id_no is a decimal(8,2) type...
This should be such a simple query, I thought...
TIA,
-A
I tried:
SELECT DISTINCT `id_no` , SUM( `reward` ) AS BALANCE
FROM `test_ledger`
GROUP BY `id_no`
But it is not returning the expected result...
id_no is varchar and id_no is a decimal(8,2) type...
This should be such a simple query, I thought...
TIA,
-A