Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Impossible SQL query?
If it's any consolation, doing this logic client-side using some
procedural code will likely be much faster than any SQL-based solution.
My solution involves two passes over the table, with subqueries for
each End row. You can do the whole thing client-side in a single pass.
Just add every Begin you see to the end of a linked list; every time
you see an End, remove the Begin from the head of the linked list -
that is your begin/end pair; if there are no elements in the list,
throw the end away.
-Steve Received on Wed Oct 05 2005 - 11:19:32 CDT