So you want to convert an attribute with string (varchar) type to a number (integer) in your mysql query ?
If you have enough time have a look here, otherwise just blindly follow the following example.
Suppose you have some code 002, 007, 001 that you want to be 2, 7, 1.
the
So far so good, isn't it ?
If you have enough time have a look here, otherwise just blindly follow the following example.
Suppose you have some code 002, 007, 001 that you want to be 2, 7, 1.
SELECT CAST(CODE AS UNSIGNED) FROM MY_TABLE;The same scenerio may be repeated with other types, it that case
the
type
for the result can be one
of the following values:
So far so good, isn't it ?
No comments:
Post a Comment