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
Post a Comment