sql - Replace all occurrences of more than one whilespace character with a single one -


input:

rammar  narayana raja  rani. 

output:

rammar narayana raja rani. 

in c# code oculd this:

    while (name.contains("  "))     {         name = name.replace("  ", " ");     } 

that replaces double single spaces , should store in same variable. here want replace more 1 whitespace in string 1 whitespace, occurance. how can in oracle sql?

try way:

select regexp_replace('aa      b     cc     d  e f ', '( ){2,}', ' ') dual; 

for details, see here; it's 1 of examples.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -