PL/SQL challenge

From: <ab831_at_detroit.freenet.org>
Date: 1995/06/27
Message-ID: <3snvcm$1vm_at_lastactionhero.rs.itd.umich.edu>#1/1


Hi all,

I don't know if this will really be a challenge for some of the geniuses you encounter in this group, but maybe...

Situation:

Two tables, one key field, one to many relationship.

Sample structure:

ORDER                      ORDER_CHANGE
------                     -----------
ORDER_ID;                  ORDER_ID 
CUSTOMER_ID;               ORDER_STATUS 
SHIP_TO_ID:                CHANGE_DATE 

... GRIEF_CODE
... ...

What occurs is an order has a variety of statuses (e.g., entered, initiated, backordered, stopped, etc.) and has a date associated with each of these statuses (i.e., when a change in status occurs the date is recorded). It is also possible for an order to be stopped, resumed, and stopped again. What I need to do is write a little snippet that will do the following:

Grab a set of fields from the ORDER table as well as the *first* date where the GRIEF_CODE meets a certain criteria (e.g., is equal to some string) for that particular order in question.

Any ideas?

BTW, the data modeling was not performed by me...

Thanks,

Chuck Received on Tue Jun 27 1995 - 00:00:00 CEST

Original text of this message