I have an issue with the SUM-Function in my MySQL Workbench. When I use the function, it returns a false value. I´d like to SUM these three numbers:
- 56,03
- 35,59
- 54,35
The result should be 145,97, but its just 145 instead. I tried these different codes:
SELECT SUM(price) FROM table;
This one returns the value 145.
SELECT ROUND(SUM(price),2) FROM table;
The second one returns the value 145.00.
I was wondering whats wrong with the code, because I tried it in another DB that I have in my MySQL Workbench. Also tried it over the Terminal in both databases. In the other database the function works correctly.