Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> SQL puzzle -- flattening a parent child relationship
There are a few threads on this issue, but none really answer this
question:
I have 2 tables:
parent:
ID VALUE
1 A 2 B child: ID VALUE 1 X 1 Y 1 Z 2 X 2 Y
Is it possible using just (Oracle) SQL to join these tables and return a single record for each parent? The desired results for this example are:
1,A,X,Y,Z
2,B,X,Y
I have considered using an inline view to flatten the child into:
1,X,Y,Z
2,X,Y
which would seem to solve the problem, but don't have a solution for that either.
Clearly this is a non-issue using any variety of programming constructs, but I'd like to do it in "pure" SQL and don't even know if it is possible.
Thanks for your help,
John Received on Tue Apr 02 2002 - 19:07:30 CST