Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> sql query substr
Hello List,
Look into the queries below, why the result of first two queries is starting with a blank space, and to get rid of this I have to substr from position 2 rather than 1.
select substr(to_char(34.25,'99.99'),1,5) col1 from dual; --result is
' 34.2'
select substr(to_char(-4.25,'99.99'),1,5) col1 from dual; --result is
' -4.2'
select substr(to_char(34.25,'99.99'),2,5) col1 from dual; --result is
'34.25'
select substr(to_char(-4.25,'99.99'),2,5) col1 from dual; --result is
'-4.25'
TIA Krishan
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Feb 08 2006 - 15:32:27 CST
![]() |
![]() |