Home » SQL & PL/SQL » SQL & PL/SQL » Find missing orders (Oracle 9.2.0.1 on Windows 2000 Server)
Find missing orders [message #351634] Wed, 01 October 2008 16:09 Go to next message
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
Re: Find missing orders [message #351650 is a reply to message #351634] Wed, 01 October 2008 23:40 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
http://www.orafaq.com/forum/m/351234/102589/?#msg_351234

Regards
Michel
Re: Find missing orders [message #351676 is a reply to message #351650] Thu, 02 October 2008 05:38 Go to previous message
dkranes
Messages: 25
Registered: February 2008
Location: Upstate New York
Junior Member
Excellent. Thank you Michel.

Smile

David
Previous Topic: how to I make relationships between tables in oracle
Next Topic: Problem when using Collection
Goto Forum:
  


Current Time: Thu Feb 06 10:11:34 CST 2025