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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL statements

Re: SQL statements

From: colmkav <colmjkav_at_yahoo.co.uk>
Date: Tue, 26 Jun 2007 12:30:47 -0700
Message-ID: <1182886247.159136.267080@j4g2000prf.googlegroups.com>


On 26 Jun, 19:11, sybra..._at_hccnet.nl wrote:
> On Tue, 26 Jun 2007 10:02:24 -0700, colmkav <colmj..._at_yahoo.co.uk>
> wrote:
>
>
>
> >Can anyone explain why when I run the first statement in Oracle XE I
> >get lots of records where sourceid = 3 and the riskdate is 18-JUN-07,
> >however when I run the 2nd statement I get the result 0 returned?
> >Surely I should get no records with a date of 18-jun-07 if the second
> >statement returns 0?
>
> >select * from ta_sma where sourceid = 3 order by riskdate desc
>
> >select * from ta_sma where sourceid = 3 and riskdate = '18-jun-07'
>
> If riskdate is a date, it can potentially also store a time. However
> Oracle always supplements those parts of a date literal you don't
> specify from the sysdate.
>
> --
> Sybrand Bakker
> Senior Oracle DBA

ok, thanks all. I guess I need to use the to_date function on it. Received on Tue Jun 26 2007 - 14:30:47 CDT

Original text of this message

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