Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cut string in a Select

Re: Cut string in a Select

From: valigula <valigula_at_gmail.com>
Date: 10 May 2007 09:17:39 -0700
Message-ID: <1178813859.740903.284430@y80g2000hsf.googlegroups.com>

        select mat_codigo,  

decode(length(replace(translate(mat_codigo,'0123456789','0000000000'),'0',''))

		   ,NULL
		   , mat_codigo
		    , substr(mat_codigo,3,length(mat_codigo)-1) )
			--from ma_con_matriculas
				 ||
 
to_char( decode(length(replace(translate(mat_codigo,'0123456789','0000000000'),'0',''))
		   			, NULL
				    , ''
					, ascii(substr(mat_codigo, 1))-64 		||
					ascii(substr(mat_codigo, 2))-64)
					)  as mat_cod_ne
-- 					as mat_codigo_nuevo
-- 					, substr(mat_codigo, 3,length (mat_codigo_nuevo) )

					from ma_con_matriculas

This is what i got so far but still with the same question, is it possible to join the new values at the beging of the string???

TY.

A Received on Thu May 10 2007 - 11:17:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US