How to best match strings
Date: 22 Aug 2002 09:00:01 -0700
Message-ID: <804a1aa9.0208220800.4683e155_at_posting.google.com>
I have a table where the primary key field can have values that range
in length between 2 and 7 characters.A client application has an input
of a string that has a length of exactly 7 characters. The application
need to identify the row whose primary field contains the substring
that the input string starts with, e.g, Input is 'hello', then the
following rows apply, 'he', 'hello'. The approach I'm using now is to
select from the table using the whole string. If no data was found,
then I select using a substring of the input string without the last
character, and another select without the laste two characters, and so
on until I find the rows I need.
I find this approach slow and resource consuming. Can someon suggest a
more efficient approach.
Thanx
Received on Thu Aug 22 2002 - 18:00:01 CEST