Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: oracle date problem

Re: oracle date problem

From: Chuck <skilover_nospam_at_bluebottle.com>
Date: Wed, 22 Feb 2006 20:16:59 GMT
Message-ID: <%E3Lf.3389$p02.2062@trndny08>


krish wrote:
> I have a query which has a date comparision in the where clause.
>
> The query looks as
>
> 1. select count(*) from table where DTTM > '10-Jan-06';
>
> 2. select count(*) from table where to_char(DTTM) > to_char('2006-01-10
> 12:35:44');
>
> 3. select count(*) from table where to_date(DTTM, 'yyyy-mm-dd
> hh24:mi:ss') > to_date('2006-01-10 12:35:44', 'yyyy-mm-dd hh24:mi:ss');

Q1 is doing a date comparison (assuming DTTM is defined as a DATE column).

Q2 is doing a string comparison.

Q3 is doing a data comparison but against a different constant (i.e. it's comparing to 2006-01-10 12:35:44 whereas Q1 is comparing 2006-01-10 00:00:00).

-- 
To reply by email remove "_nospam"
Received on Wed Feb 22 2006 - 14:16:59 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US