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

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -