Re: Select previous records
Date: Fri, 8 May 2009 07:22:07 +0200
<art_at_unsu.com> a écrit dans le message de news: 8ea8aea2-4a21-461e-89cc-c7fffaa50bf6_at_u10g2000vbd.googlegroups.com...
| Hoping to do this in one query without writing code.
| Got an order table:
| Customer ID
| Order Date
| 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