Cast/Convert BigInt to Varchar in MySQL

匿名 (未验证) 提交于 2019-12-03 03:06:01

问题:

How might I Cast/Convert BigInt to Varchar in MySQL?

回答1:

 mysql> select  Cast( 12345678901234567890 as char) ; +-------------------------------------+ | Cast( 12345678901234567890 as char) | +-------------------------------------+ | 12345678901234567890                |  +-------------------------------------+ 


回答2:

I think you can't cast to varchar, try char instead. Or are you trying to modify the type of an existing field of a table? Then you have to do for example:

ALTER TABLE MODIFY COLUMN mycolumn varchar(50);



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!