Home >Database >Mysql Tutorial >mysql中varchar与integer的互转_MySQL

mysql中varchar与integer的互转_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:44:231357browse

bitsCN.com

 

其实转换是很简单的如下代码

 

 

 

declare bn varchar(30) default ''; set bn = (cast(bn as SIGNED INTEGER) + 1)+''; 先将bn转为integer去做加法运算,然后再转成varchar

 

本文出自 “乔磊的博客 学习 进步” 博客

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn