Home » SQL & PL/SQL » SQL & PL/SQL » string matching (
string matching [message #406483] Thu, 04 June 2009 03:40 Go to next message
Messages: 93
Registered: October 2008
Location: Nepal
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?

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
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: 65150
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
We don't do homework, post what you tried so far.


Previous Topic: How to find out the user name or login name
Next Topic: Performance Imorvement for Oracle Query
Goto Forum:

Current Time: Mon Aug 21 14:55:05 CDT 2017

Total time taken to generate the page: 0.01739 seconds