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: gpost <pacopost***_at_post.t-com.hr>
Date: Tue, 26 Jun 2007 17:06:14 +0000 (UTC)
Message-ID: <Xns995BC25622BE7gpostposttcomhr@195.29.150.88>


colmkav <colmjkav_at_yahoo.co.uk> wrote in news:1182877344.598359.81440 @n2g2000hse.googlegroups.com:

>
> 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'
>
>

Maybe trunc is your answer:

select * from ta_sma where sourceid = 3 and TRUNC(riskdate) = TO_DATE ('18.06.2007', 'DD.MM.YYYY') Received on Tue Jun 26 2007 - 12:06:14 CDT

Original text of this message

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