开发者

How to convert numeric field (size: 10) to character field (size: 7)

开发者 https://www.devze.com 2023-02-26 17:53 出处:网络
How can i do to convert numeric field (size: 10) to character field (size: 7) ..? Thx开发者_高级运维.In MySQL it is possible to do something like this:

How can i do to convert numeric field (size: 10) to character field (size: 7) ..? Thx开发者_高级运维.


In MySQL it is possible to do something like this:

RIGHT(CAST(intvalue AS char), 7)

If the integer value is greater than 9,999,999, you will lose the highest order digits, of course.


Depends on DBMS Oracle: TO_CHAR() , SQL Server str(). These are formating functions. For plain type conversion you can use cast

0

精彩评论

暂无评论...
验证码 换一张
取 消