Select previous records

From: <art_at_unsu.com>
Date: Thu, 7 May 2009 17:36:37 -0700 (PDT)
Message-ID: <8ea8aea2-4a21-461e-89cc-c7fffaa50bf6_at_u10g2000vbd.googlegroups.com>


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.... Received on Thu May 07 2009 - 19:36:37 CDT

Original text of this message