Question

I write a select:

select orderid, 
       unitprice*(1-discount)*quantity as "a", 
       to_char(unitprice*(1-discount)*quantity, '99999D99') as "SUM"
from OrderDetails
where unitprice*(1-discount)*quantity > 5000


Result is:
enter image description here
How delete only first space?
Mask for char (only 8 symbols):
[number/space][number/space][number/space][number/space][number].[number][number]
If use 'FM', when result:
enter image description here
But, i need:
enter image description here

Was it helpful?

Solution

The leading space is for the sign. If you are sure you use only positive numbers you can remove the sign token with a substring. If you have a sign you can put it at the end if you want like this:

99999D00S

OTHER TIPS

It appears that you want the format mask of your to_char to be fm9999D00, i.e.

to_char(unitprice*(1-discount)*quantity, 'fm99999D00') as "SUM"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top