在MySQL中,可以使用CAST()函數(shù)將數(shù)字轉(zhuǎn)換為字符。
CAST()
例如,將數(shù)字列num轉(zhuǎn)換為字符列str:
num
str
SELECT CAST(num AS CHAR) AS str FROM table_name;
另外,也可以使用CONVERT()函數(shù)將數(shù)字轉(zhuǎn)換為字符:
CONVERT()
SELECT CONVERT(num, CHAR) AS str FROM table_name;
億速云公眾號(hào)
手機(jī)網(wǎng)站二維碼
Copyright ? Yisu Cloud Ltd. All Rights Reserved. 2018 版權(quán)所有
廣州億速云計(jì)算有限公司粵ICP備17096448號(hào)-1 粵公網(wǎng)安備 44010402001142號(hào)增值電信業(yè)務(wù)經(jīng)營(yíng)許可證編號(hào):B1-20181529