Categories
MySQL get sum of all values without sign?
There is a column "money", it has negative and positive values, it is necessary to calculate the sum of all entries, without taking into account the sign. What is the best way to do this?
Answer the question
In order to leave comments, you need to log in
SELECT SUM(ABS(fieldname)) FROM tablename
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question