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: How to Select last 30 days

Re: How to Select last 30 days

From: Alfons Riesebeek <A.Riesebeek_at_wxs.nl>
Date: 5 Oct 1998 14:47:14 GMT
Message-ID: <01bdf06f$029cf9c0$432d15ac@tonta000157>


Hello,

You can do it in PL/SQL like this:

Set serveroutput on

 Declare
 output date;
 Begin
 For teller in 1 .. 30 Loop

    select sysdate-teller into output from dual;     dbms_output.put_line(output);
 end loop ;
 End;

The item is " sysdate - a counter" . In Sql it is " select sysdate, sysdate-1,...... from dual; " but PL/SQL or some other script is a better solution

I hope this will help .
Rergards Alfons Riesebeek  

Chakravarthy KM Nalamotu <kittu_at_Hawaii.Edu> schreef in artikel <6vahql$2l4_at_news.Hawaii.Edu>...
> Hello Oracle Users,
> Is there a way to write a SQL SELECT statement and return the last 30
days
> dates starting from SYSDATE?
> I could not think of a way to do it.
> Your response is greatly appreciated.
> Thanx,
> Kittu.
>
Received on Mon Oct 05 1998 - 09:47:14 CDT

Original text of this message

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