Find missing orders [message #351634] |
Wed, 01 October 2008 16:09  |
dkranes
Messages: 25 Registered: February 2008 Location: Upstate New York
|
Junior Member |
|
|
Hello, I have a scenario where I have an orders table that has a parent order and in many cases 1 or many child orders associated with it. The child orders represent those orders that have been split between stores that can fulfill the order. Due to some network outages we have encountered recently, there are now missing child orders. I have another table that tells me the parent order id and the last or max child order id associated with it. I need to determine which parent orders have missing child orders based on knowing the max order id. The order id's for the parent and each child are the same except for the last 2 digits. For example:
000751001080010536560100 - parent
000751001080010536560101 - Child 1
000751001080010536560103 - Child 2
In the case where we have missing child orders, the order id's are not sequential in the orders table.
How can I determine which ones are not sequential and of those which child is missing.
Any ideas would be greatly appreciated.
Thank you,
David
|
|
|
|
|