开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜