Subject | Re: [firebird-support] Re: Help |
---|---|
Author | Paul Vinkenoog |
Post date | 2003-08-06T12:05:10Z |
Hi Eyal,
(because that will only compare a few values), but for the STARTING
WITH.
Greetings,
Paul Vinkenoog
> Assuming bin_table/bin_num hold the bin numbers, and search_bin isThis looks like the simplest and best solution so far!
> the value for which you try to find the best match, try:
>
> SELECT MAX(bin_num) FROM bin_table WHERE :search_bin STARTING WITH
> bin_num
> I tested it on a few values and it seems to do what you want, but ofI think a lex index on bin_num would help a lot, not for the MAX
> course you'll have to test more. This is not an efficient query and
> indexes can't help much if at all, however if you have up to several
> thousands of records it should be ok.
(because that will only compare a few values), but for the STARTING
WITH.
Greetings,
Paul Vinkenoog