miércoles, 2 de noviembre de 2016

TRIM

La función de Oracle TRIM elimina todos los caracteres especificados, ya sea desde el principio o el final de una cadena.

LEADING
The function will remove trim_character from the front of string1.
TRAILING
The function will remove trim_character from the end of string1.
BOTH
The function will remove trim_character from the front and end of string1.

Nota
  • Si usted no elige un valor para el primer parámetro (LEADINGTRAILINGBOTH), la función TRIM eliminarátrim_character tanto desde el frente y al final de cadena1 .



SELECT TRIM('   OpenMind   ')
    FROM DUAL;
Resultado: 'OpenMind'

SELECT TRIM(' '  FROM  '   OpenMind   ')
    FROM DUAL;
Resultado: 'OpenMind'

SELECT TRIM(LEADING '0' FROM '000123')
    FROM DUAL;
Resultado: '123'

SELECT TRIM(TRAILING '1' FROM 'OpenMind1')
    FROM DUAL;
Resultado: 'OpenMind'

SELECT TRIM(BOTH '1' FROM '123OpenMind111')
    FROM DUAL;
Resultado: '23OpenMind'



También podemos consultar RTRIM y LTRIM.




Share:

0 comentarios:

Publicar un comentario

Archivo

Cual es el tema de mayor interes para ti?