Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to Select last 30 days
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