Home > Database > Mysql Tutorial > body text

How to use SUM function on NUMC type fields?

王林
Release: 2023-08-25 09:29:07
forward
1275 people have browsed it

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!