Friday, September 18, 2015

Filter String only/Number Only from Set of Strings.


--- Number only from set of strings using TRANSLATE

SELECT TRANSLATE(UPPER('342fgs1dfsN'), '1ABCDEFGHIJKLMNOPQRSTUVWXYZ', '1') a FROM DUAL;

--- String only from set of strings using TRANSLATE

SELECT TRANSLATE('342fgs1dfsN', '0123456789', '1') a FROM DUAL;

--- Number only from set of strings using Regular Expressions

SELECT REGEXP_REPLACE('3NASDasdas','[a-zA-Z'']','')  FROM DUAL;

--- String only from set of strings using Regular Expressions

SELECT REGEXP_REPLACE('3NASDasd5345as','[0-9'']','')  FROM DUAL;

No comments:

Post a Comment