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 -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -