Home » SQL & PL/SQL » SQL & PL/SQL » string matching (10.2.0.4.0)
string matching [message #406483] Thu, 04 June 2009 03:40 Go to next message
maheshmhs
Messages: 93
Registered: October 2008
Location: Nepal
Member
I have a table that contains name of companies and its code.
i want to display from that table the name/code of company whose name has highest match of characters with the name i supply.
eg if table has
name   code
abcdef 555
abd 234
abefgh 239

now i have a string 'abidgh'. it is to be compared with the table
and retrun abefgh 239 because maximum characters of abidgh match with abefgh.

Any suggestions on how to do it?

Thanx
Mahesh Acharya

Re: string matching [message #406488 is a reply to message #406483] Thu, 04 June 2009 04:11 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
What algorithm do you want to use to compare the strings?

Are you comparing :
the number of positions in each string that match
the number of matching pairs of letters
the Soundex
some measure of how far from each position in the target string the nearest matching letter in the source string is.

Re: string matching [message #406489 is a reply to message #406483] Thu, 04 June 2009 04:11 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
We don't do homework, post what you tried so far.

Clue: LENGTH, MAX or RANK

Regards
Michel
Previous Topic: Cost of execution
Next Topic: Is it safe to rely on ROWID if the row is locked?
Goto Forum:
  


Current Time: Sun Dec 04 21:00:02 CST 2016

Total time taken to generate the page: 0.18118 seconds