sql - Detect duplicate string or word in a row -


i want know how detect duplicate word in row. ensure have clean data in our database.

for example see below

name                            count james james mccarthy            1 donald hughes hughes            1 

i want result like

name                     count james mccarthy            1 donald hughes             1  

is there solution using oracle sql?

for adjacent words

select  1    dual   regexp_like ('john john doe','(^|\s)(\s+)\s+\2(\s|$)') ; 

or

select  case when regexp_like ('john john doe','(^|\s)(\s+)\s+\2(\s|$)') 'y' end adj_duplicate    dual ; 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -