SQL Query

Mamajyot

Senior Member
Joined
Feb 6, 2009
Messages
840
Reaction score
64
Location
Somewhere in ZA.......
Hi

I am using oracle sql and I want to produce the ffg output but am having problems.

I want the comma's to be replace with spaces but I cant figure out how to do it.



SQL> SELECT To_Char(123000,'999,999,999.99')
2 FROM dual;

TO_CHAR(123000,
---------------
123,000.00
 
Hi

I am using oracle sql and I want to produce the ffg output but am having problems.

I want the comma's to be replace with spaces but I cant figure out how to do it.



SQL> SELECT To_Char(123000,'999,999,999.99')
2 FROM dual;

TO_CHAR(123000,
---------------
123,000.00

Sorry, I dont know Oracle at all but won't this work?

SELECT REPLACE(To_Char(123000,'999,999,999.99'), ',' , ' ') FROM dual;
 
I too know nothing about Oracle, but isn't the problen the formatting in the T_Char,

SELECT To_Char(123000,'999,999,999.99')
123,000.00

Have you tried something like:
SELECT To_Char(123000,'999 999 999.99')

(Without the commas)
 
Comma's work

Hi Guys,

I eventually used "SELECT To_Char(123000,'999,999,999.99') "

Oracle number formatting does not allow for spaces in the formatting part.

Thanks
 
Top
Sign up to the MyBroadband newsletter
X