Wednesday, 15 June 2011

How to format user input names on a large set of data from a sql/oracle database? -



How to format user input names on a large set of data from a sql/oracle database? -

i have table stores names input user text edit box.

there no selection or masking on input box

this leads database have inconsistent info such as

john doe john dow jonh doe johh doe

when name supposed john doe.

i wondering how create single query can handle parsing names supposed (i know of wrongly spelt name occurances) multple user names .

example:

select name tablename set ( if(name = 'john dow' or name = 'johh doe') name = 'john doe' ) ( if(name = 'janee doe' or name = 'jaan doe' name = 'jane doe' )

using sql , oracle developer

well, can utilize case:

update tablename set name = (case when name in ('john dow', 'johh dow') 'john doe' when name in ('janee doe', 'jaan doe') 'jane doe' else name end)

you might want include where clause limit number of rows updated same value:

name in ('john dow', 'johh dow', 'janee doe', 'jaan doe')

sql oracle spell-checking data-entry

No comments:

Post a Comment