oracle 数据类型转换为字符串

oracle 数据类型转换为字符串
直接转换
SELECT to_char(1000000000000) AS str
FROM dual—1000000000000
SELECT to_char(100.123) AS str
FROM dual—100.123
SELECT to_char(0.123456) AS str
FROM dual—.123456
加个修饰转换
SELECT rtrim(to_char(1000000000000,‘FM9999999999990D99999999999’),to_char(0,‘D’) ) AS str
FROM dual—1000000000000
SELECT rtrim(to_char(0.123,‘FM9999999999990D99999999999’),to_char(0,‘D’) ) AS str
FROM dual—0.123
SELECT rtrim(to_char(100.123,‘FM9999999999990D99999999999’),to_char(0,‘D’) ) AS str
FROM dual—100.123

你可能感兴趣的:(ORACLE)