mysql中數(shù)字轉(zhuǎn)字符怎么實(shí)現(xiàn)

小億
85
2024-05-06 12:46:48
欄目: 云計(jì)算

在MySQL中,可以使用CAST()函數(shù)將數(shù)字轉(zhuǎn)換為字符。

例如,將數(shù)字列num轉(zhuǎn)換為字符列str

SELECT CAST(num AS CHAR) AS str FROM table_name;

另外,也可以使用CONVERT()函數(shù)將數(shù)字轉(zhuǎn)換為字符:

SELECT CONVERT(num, CHAR) AS str FROM table_name;

0