I am trying to sum my decimal records e.g.
There is a column in my table named cash having values like 40.33, 30.00, 77.22. How can I create a query that sum up these records? I am trying hard using SUM(cash)
and ROUND(SUM(cash),2)
but no result.
SELECT cash FROM `enrolled
return rows.
SELECT ROUND(SUM(cash),2)`
return 0 row.
try this.
SELECT ROUND(SUM(cash), 2)
FROM <tablename>
If you are getting no results, then there must be a null value, try this instead.
SELECT ROUND(SUM(cash), 2)
FROM<tablename> a
WHERE cash IS NOT NULL
Tell me if there is anything else to help you with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With