Home >Database >Mysql Tutorial >How to use SUM function on NUMC type fields?

How to use SUM function on NUMC type fields?

王林
王林forward
2023-08-25 09:29:071332browse

How to use SUM function on NUMC type fields?

NUMC is numeric text. Since this is text, the SUM function cannot be implemented since it is a varchar type in the database.

There is no simple solution to do this. One way is to copy the data to an internal table, convert the NUMC data to DEC by looping through all the rows, summing and grouping them, and then converting the DEC values ​​back to NUMC values.

The above is the detailed content of How to use SUM function on NUMC type fields?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete