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: Oracle SQL Help

Re: Oracle SQL Help

From: ext237 <ext237_at_somewhere.com>
Date: 27 Feb 2004 09:01:09 -0600
Message-ID: <5lmu309un5l0fdvnmhifen7qaq9fh88re6@4ax.com>


On Fri, 27 Feb 2004 09:44:24 -0500, "Mark C. Stock" <mcstockX_at_Xenquery .com> wrote:

>date arithmetic is in days
>
>sysdate is the current system date (on the database machine, not the client
>or app server)
>
>so, 60 minutes ago is: (sysdate - (1/24))
>
>use this expression in your predicate and avoid using a function on the
>actual column (general performance guideline, in case the column is indexed)
>
>AND CREATED_DTM >= (sysdate - (1/24))
>
>[ my apologies to purists for spool-feeding this one, but date handling is
>taught incorrectly in most SQL intro classes, so i feel strongly that a
>complete example is warranted ]
>
>;-{ mcs

No apologies needed, this exactly solved my issue! Thanks!!

I'm one of those incorrectly instructed on date handling. Most of my q's, when dates are involved, are quite slow. Thanks for the tutorial!

ext237 Received on Fri Feb 27 2004 - 09:01:09 CST

Original text of this message

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