There is a problem that does not know how to resolve only with SQL (I could do it with PL / SQL, but this should only be done with SQL).
I have a table (in fact, this is not a table, but the result of query c) contains a couple of values:
column1 column2
--------- ---------
value1 value2
value1 value3
value2 value4
value3 value7
value8 value9
I want this data to 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 datasets associated with either of the two values.
Each pair of the input table is unique (the secondary value is always on the left, and I used a separate one to calculate the input table).
I have absolutely no idea how to do this with the model, and my efforts with the connection, complaining about the "circular data". At first, this does not look difficult, but it cannot understand how to do it in a non-procedural way. Any thoughts?
Thanks in advance.
source share