Subject Re: [firebird-support] Speed optimization required for DELETE query
Author Vishal Tiwari
Hi,
 
Thanks alot for your focusing light on my darkness in SQL.
 
Ya, surely i should and i must accept that  i made a big mistake.
 
A Heartful thanks for showing me my mistake.
 
Obviously, i will never come up with such mistakes (so long as possible i will never).
 
Definitely you will be my second GURU (Teacher) in SQL field.
 
Thanks alot.
 
Have A Nice Day.
 
Vishal Tiwari....

--- On Thu, 10/9/09, Kjell Rilbe <kjell.rilbe@...> wrote:


From: Kjell Rilbe <kjell.rilbe@...>
Subject: Re: [firebird-support] Speed optimization required for DELETE query
To: firebird-support@yahoogroups.com
Date: Thursday, 10 September, 2009, 12:42 PM


 



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
--
------------ --------- --------- --------
Kjell Rilbe
DataDIA AB
E-post: kjell@datadia. se
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
















See the Web's breaking stories, chosen by people like you. Check out Yahoo! Buzz. http://in.buzz.yahoo.com/

[Non-text portions of this message have been removed]