Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Converting two numbers into one string
Dear all,
When two numbers are to be converted into one string like this one: SELECT 2001 year, 12 month, LTRIM(TO_CHAR(2001,'0000')) || LTRIM(TO_CHAR(12,'00')) yyyymm FROM DUAL;
year month YYYYMM
--------- --------- --------
2001 12 200112
LTRIM has to be prefixed to both number conversions, which makes the SQL very time-consuming and the statement look ugly for a simple conversion like this. Any possibility to suppress the LTRIM? Thanks.
Dino Received on Mon Apr 16 2001 - 22:26:50 CDT
![]() |
![]() |