I am trying to prepare data for a new table which is the same data from exisiting tables but denormalized. I have a simple scenario but my mind is drawing a blank at the most efficient way of returning the results
It is based on the following simplified scenario:
Table X | Table y
id | id Identifier Value
123 | 123 1 A
| 123 2 B
Along with further fields from table X I need my query to return:
123 A B
I have considered:
Solution One
select
id,
(select Value...),
(select Value...)...
Solution Two:
select id,
y1.Value,
y2.Value
from x, y y1, y y2...
Solution Three: Using PL/SQL and iterating through a cursor
Solution Four: Extracting y into two tables identifyer1 and identifier2 (potentially using triggers) and joining those tables within in the query instead
Each of these solutions has a major drawback for one reason or another and I'm sure one word could remind me of a concept to solution this