Get string not a number by SUM() in node sequelize
Recently we're building the analytics functions. In one SQL query of analytics functions, we found that the SUM() result is a string not a number. That causes the final total number is a string connecting result, not a number sum result.
Search this situation on the Google. There is an issue in Sequelize project page.
The reason is that SUM() result's type is
To set a SUM() result as
DECIMAL is reasonable. Because the SUM() result may be float type. If SUM() result is a number, there would be floating point issue.
DECIMAL as a
String type data is necessary.