Re: Select previous records

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Fri, 8 May 2009 07:22:07 +0200
Message-ID: <4a03c17d$0$6600$>

<> a écrit dans le message de news:
| Hi,
| Hoping to do this in one query without writing code.
| Got an order table:
| Customer ID
| Order Date
| Status
| Customer places an order, status becomes 'Active' and 1 year later the
| customer can re-new or cancel. If customer renews then current order
| goes to 'Complete' and new order is placed with 'Active'.
| I need to know, for any given date, is current 'Active' order result
| of a 'renew'. So, is there an order 1 year ago.
| Not sure how this is done, maybe with some analytical stuff?
| Basically take order from now, look back 1 year and see if there is an
| order there.....
| Possible without PL/SQL I hope....

To know if it is possible you have to post a test case: create table and insert statements as well as the result you want with these data.

And you don't tell us what happens if customer cancels.

But as there are at least 2 operations, one update and one insert I don't see how you can do it without a programming language.

Michel Received on Fri May 08 2009 - 00:22:07 CDT

Original text of this message