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

mysql中varchar与integer的互转_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:44:23
Original
1372 people have browsed it

bitsCN.com

 

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

 

 

 

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

 

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

bitsCN.com
Related labels:
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template