Re: How to best match strings
Date: 22 Aug 2002 18:49:24 -0700
Message-ID: <42ffa8fa.0208221749.552e6823_at_posting.google.com>
Wouldn't something simple like this solve your problem?
select * from <table_name> where
or did I misunderstand your problem? You can build a function based
index with substr on the column in question to boost the performance.
gloai_at_hotmail.com (Loai Garelnabi) wrote in message news:<804a1aa9.0208220800.4683e155_at_posting.google.com>...
substr(<column_name>,1,1)=substr(<variable_name>,1,1);
> 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 Fri Aug 23 2002 - 03:49:24 CEST