difficult select- question
Date: Mon, 26 Oct 2009 13:08:52 +0100
I hope, there is someone with a good idea concerning the following question:
There is a sorted Table (or view) like the following:
F1|F2|F3|F4 AA|BB|10|20 AA|BB|20|30 AA|BB|40|50 AA|BB|50|60 AA|BB|60|70 AA|CC|70|80 AA|CC|80|90
As you can see there are some rows, that are connected by F3=prior F4, but there are leaks too. I need a result as the following:
AA|BB|10|30|2 parts AA|BB|40|70|3 parts AA|CC|70|90|2 parts
I know it is easy to solve by programming.
I think it is possible to do this with inline view and hierarchical
I can imagine a way by select min(F3), max(F4) ... where exists (enough connecting data in the middle).
But what is the best (SQL-)way to solve this? (There actually are about
15000 lines, the estimated result probably should not have more than 100
I could do it by PL/SQL, but I am interested in SQL, if exists
-- wenn email, dann AndreasMosmann <bei> web <punkt> deReceived on Mon Oct 26 2009 - 07:08:52 CDT