Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Effective ways of doing date arithmatic
On Mar 22, 2:56 pm, "nirav" <shiva..._at_gmail.com> wrote:
> > That should be just a matter of writing an update statement using the
> > values from the first table.
> > For simplicity you could also use: SELECT birthdate + INTERVAL '65'
> > YEAR
>
> Thanks but the requirements are slightly different...plz refer the
> first post where I mentioned it...like go back a month if...and
> truncate to first if..etc. your solution does not do that conditional
> thing right...but is use of interval..basically superior to
> trunc(add_months(birthdate, 12 * 65) - 1, 'MM') approach?
>
> again my thanks for sharing your views
> Nirav
I don't know if the use of interval is any superior to your approach
from a performance point of view. I prefer it as it is "eyes friendly"
if you want.
With regards to the other question, you could use CASE in the select
statement - sorry but I do not have time to write the query for you.
Received on Thu Mar 22 2007 - 14:25:22 CDT