I believe there must be a simple way to achieve this, I just haven't been to figure it out. I've search for a ways but I can't find anything that doesn't invlovle aggregates,
I have a dynamic query (Oracle) that I build in a loop using configuration tables with the following form:
SELECT
b1.id1,
b2.id2,
...
FROM
table_a a,
table_b b1,
table_b b2,
...
WHERE
a.id = a_variable
AND ( b1.value (+)= a.column1
AND b2.value (+)= a.column2
...);
I always expect this to return a single row, otherwise throw an error. I'm looking to have a result something like this:
---------------
|ID | VALUE |
---------------
|ID1 | 9 |
|ID2 | 8 |
|ID3 | NULL |
|ID4 | 6 |
|... |
---------------
Instead of:
-----------------------------
|ID1 | ID2 | ID3 | ID4 | ...
-----------------------------
| 9 | 8 | NULL| 6 | ...
-----------------------------
Thanks in advance!!