Hi everyone,
There is a problem that don't know how to resolve only with SQL (I could do it with PL/SQL, but it should be doable only with SQL).
I have a table (in fact it's not a table but the result of a with query) with contains pair of values like this:
column1 column2 --------- --------- value1 value2 value1 value3 value2 value4 value3 value7 value8 value9
The ouput I want for that data would be (I don't care about the order):
output_column --------------- value1, value2, value3, value4, value7 value8, value9
In other words, I want to get disjoint sets of data connected by any of both values.
Every pair in the input table is unique (the minor value is always at the left, and I have used a distinct to compute the input table).
I have absolutely no clue about how to do this with model, and my efforts with connect by complain about "circular data". This at first doesn't look to hard to do, but can't figure how to do it in a non procedural way. Any thoughts?
Thanks in advance.