0001 strings are stored in the database, how to carry out the four operations of integers?

such as the question: 0001 strings are stored in the database, how to perform the four operations of integers?

Apr.24,2022

convert directly to shaping and then calculate CONVERT (parameter, SIGNED)

(root)(none)-3306>>SELECT CONVERT('0001',SIGNED) + 12345 as result;
+--------+
| result |
+--------+
|  12346 |
+--------+

field1 is a string, just select field1+1234 it directly.

Menu