为什么Oracle的to_char()函数添加空格? [英] Why is Oracle's to_char() function adding spaces?

查看:201
本文介绍了为什么Oracle的to_char()函数添加空格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Oracle的to_char()函数添加空格?

Why is Oracle's to_char() function adding spaces?

select length('012'), 
       length(to_char('012')), 
       length(to_char('12', '000')) 
  from dual;

3, 3, 4

推荐答案

您使用的格式掩码是固定宽度,并允许减号

The format mask that you are using is fixed width and allows for a minus sign

这篇关于为什么Oracle的to_char()函数添加空格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆