|
Table RUNCARD has M, N and other fields
The data in M such as M(1)=mm001
M(2)=mm002
M(3)=mm003
......
Type varchar
Now I want to make a loop, extract the maximum value from the number part after mm in M, and attach it to num, the type is integer
Can you please take a look at my sentence?
SELECT MAX(CAST(SUBSTRING(M,2,9) AS INTEGER)) AS NUM FROM RUNCARD
I feel that the type conversion is a bit messy, please expert advice, thank you, urgent! ! ! |
|