我有如下数据库:
WITH TB AS(
SELECT 1 NONB FROM DUAL UNION ALL
SELECT 89 NONB FROM DUAL UNION ALL
SELECT 193 NONB FROM DUAL
)
SELECT * FROM TB
我想要更改列NONB to_char(NONB)
并在数字之前显示零,如下所示。
001
089
189
我该怎么做?感谢。
答案 0 :(得分:3)
使用此:
WITH TB AS(
SELECT 1 NONB FROM DUAL UNION ALL
SELECT 89 NONB FROM DUAL UNION ALL
SELECT 193 NONB FROM DUAL
)
SELECT to_char(nonb, 'FM000') FROM TB
答案 1 :(得分:2)