Subject Re: [ib-support] Advice
Author Helen Borrie
Luiz,

At 12:35 AM 13-02-02 -0300, you wrote:
>----- Original Message -----
>From: "Sandeep" <sandeep@...>
>
>
>> try this
>>
>> select Date_Birth
>> from tableA
>> where (extract (month from Date_Birth) between 4 and 5) and
>> (extract (day from Date_Birth) between 10 and 12)
>>
>It will be very slow in a big table and this is my case.

It won't cost you much to add Birth_Month and Birth_DOW smallint columns to your table, and populate them with triggers using extract() on the incoming new.Date_birth. You can index both columns and search them very fast, either together or separately.

H.


All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________