Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL grouping results by similarity

Status
Not open for further replies.

scimatic

Technical User
Aug 30, 2004
19
US
I don't know where to begin with this one. I want to query a table that contains a list of 1000's of user names. I would like the query results to show me a list of user names that are grouped by similarity. By similarity I mean user names that differ only by one or two characters usually at the begining or end of the user name or those user names where the only difference is a single space somewhere in the name.

Here is a sample of parrt of what the results whould look like:
...
joeblack
joe black
kevin
kevin10
kevin 10
...

However if a user name is not similar to any other user names it would not be included in the result set.

Does anyone have any suggestions or examples for me.

Thanks in advance.
 
could you do somethin using SOUNDEX ?
Code:
select soundex('kevin10')
select soundex ('kevin 10')
select soundex ('kevinDD 10')
select soundex('someone completely different')

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top