Re: date(year to second field)
Posted in 1998
ccremid — — source: Informix-list mailing list archive (1991-1998)
Sukumar Konduru wrote:
>
> Hi
>
> I have table with field "year to second". I need to prepare reports
> quiet
> oftern the transactions on day basis.
>
> I would like to know which is efficient to use.
>
> select * from taskresult
> where date(startedat) = today>
> or
> select * from taskresult
> where startedat >="1998-04-29 00:00:00" and> startedat <="1998-04-29 59:59:59"
>
It always a good idea to use SET EXPLAIN ON to test
this kind of sql statements.
On my system AIX 4.2 and DSA 7.23
The first statement does NOT use indexes, the second one uses indexes.
I would say go for the second one.
Hope this helps
Tino
> Could you please mail me
>
> sukumar@gte.net
>
> Thank you
> sukumar konduru