如何在 oracle 中将数字显示为百位分隔符格式?

How to display number as Hundred separator formator in oracle?

当我在 oracle 中检索数字列时得到这样的 1237.89 我想将数字列显示为 1,237.89

如何在 Oracle 中获取它。

您可以将 to_char 与可选格式参数一起使用:

SELECT TO_CHAR(mycol, '9,999.99')
FROM   mytable

我更喜欢 D(代表小数)和 G(代表千位),例如

SQL> select to_char(123456789, '999G999G990D00') result from dual;

RESULT
---------------
 123.456.789,00

SQL>