mysql查询int转字符类型

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/fan510988896/article/details/77369532

在使用mybaits查询数据,使用List<Map<String,String>>接收数据时,当id,age为int类型时,会报错,需要在查询的时候就将其转换为字符型。

查询方法如下:

SELECT CAST(pid AS CHAR(32)) pid,name,CAST(age AS CHAR) age,gender,hometown FROM person


猜你喜欢

转载自blog.csdn.net/fan510988896/article/details/77369532