Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Date comparison question
Lisa,
Queries which 'do not return' are usually queries performing full scans of death. Since the cases which return happen to be, against common wisdom, those where the date column is converted to char, could it be possible that you have a function-based index (doing the to_char() conversion) on this column ?
Regards,
Stephane Faroult
Oriole Corporation
Lisa Yates wrote:
> Why doesn't this query ever return...
>
> where run_date = to_date('01-03-2001 16:34:59','mm-dd-yyyy hh24:mi:ss')
>
> but this query does....
>
> where to_char(run_date) = to_char(to_date('01-03-2001
> 16:34:59','mm-dd-yyyy hh24:mi:ss'))
>
> and so does this query....
>
> where to_char(run_date,'mm-dd-yyyy hh24:mi:ss') = '01-03-2001 16:34:59'
>
> ?
>
> TIA
>
> Lisa
>
>
> ********************************************
> * Lisa Yates cosnit_at_creighton.edu *
> * Creighton University *
> * Omaha, Nebraska *
> * (402) 280-2419 fax: (402) 280-2573 *
> * Define the Universe, give 2 examples. *
> ********************************************
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Lisa Yates
Received on Mon Jan 08 2001 - 14:28:55 CST
![]() |
![]() |