X
X
XenK2016-07-14 08:11:21
MySQL
XenK, 2016-07-14 08:11:21

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

1 answer(s)
M
Maxim Fedorov, 2016-07-14
@XenK

SELECT SUM(ABS(fieldname)) FROM tablename

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question