Hi,
I have Oracle table with several columns. One of the fields is Order_Date.
Order_Date
24-OCT-2000
23-NOV-2000
08-DEC-2000
10-JAN-2001
04-MAR-2001
05-APR-2001
05-JUL-2001
11-NOV-2001
09-DEC-2001
I need to write a query which returns previous six orderdates (including
the date passed). For instance, if I pass 09-DEC-2001, the query should
return
09-DEC-2001
11-NOV-2001
05-JUL-2001
05-APR-2001
04-MAR-2001
10-JAN-2001
And if I pass 05-APR-2001, the query should return
05-APR-2001
04-MAR-2001
10-JAN-2001
08-DEC-2000
23-NOV-2000
24-OCT-2000
I would appreciate if somebody could help to write the query.
Thanks
I have Oracle table with several columns. One of the fields is Order_Date.
Order_Date
24-OCT-2000
23-NOV-2000
08-DEC-2000
10-JAN-2001
04-MAR-2001
05-APR-2001
05-JUL-2001
11-NOV-2001
09-DEC-2001
I need to write a query which returns previous six orderdates (including
the date passed). For instance, if I pass 09-DEC-2001, the query should
return
09-DEC-2001
11-NOV-2001
05-JUL-2001
05-APR-2001
04-MAR-2001
10-JAN-2001
And if I pass 05-APR-2001, the query should return
05-APR-2001
04-MAR-2001
10-JAN-2001
08-DEC-2000
23-NOV-2000
24-OCT-2000
I would appreciate if somebody could help to write the query.
Thanks