Oracle Query to remove all Numeric, Characters ... from the text

Bellow we will use the REPLACE Function to remove all Numeric, Characters or Special characters from the text in Oracle.

Ex: KH +855 10515239

Example 1: Remove all Numeric and Special characters



SQL: 

SELECT  REGEXP_REPLACE('KH +855 10515239', '[^A-Z]+', '') AS out_put FROM DUAL;


Example 2: Remove all Characters and Special characters keep only numeric


SQL:

SQL: SELECT  REGEXP_REPLACE('KH +855 10515239', '[^0-9]+', '') AS out_put FROM DUAL;







Post a Comment

Previous Post Next Post