Subject Re: [firebird-support] Speed optimization required for DELETE query
Author Kjell Rilbe
Dimitry Sibiryakov wrote:

>>> Extract(Year from C.dt_Date) <= '2007'
>>> And
>>> Extract(Month from C.dt_Date) <= '03'
>> C.dt_date <= '03/01/2007'
> These conditions are far not the same.

Oh, the details, the details. These are the things that can make your
brain burn up, trying to figure out what the *** is happening. :-)

Well spotted Dimitry!

Just in case others find it difficult to see what the difference is:

The Extract... thingy will select recs with year 2007 and older and
month Jan-Mar, i.e. Jan-Mar 2007, Jan-Mar 2006, Jan-Mar 2005 and so on.
It will not select Apr-Dec for any year.

The simple date comparison will, of course, select all dates on or
before March 1 2007, including Apr-Dec for all years 2006 and older.

I suspect Vishal wants the latter...?

Kjell Rilbe
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64