문제

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

도움이 되었습니까?

해결책

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

다른 팁

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"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top