I have a parent table
ID Name
1 abc
2 def
and child table
ID LineId Item
1 1 A001
1 2 A002
2 1 B001
2 2 B002
The ID in the child table is the foreign key from the parent table and both ID and LineId make up the primary key in the child table.
I want to join these two table based on 'ID' from both parent and child table to produce a flat result with rows from child tables having the same foreign key become columns, like this:
ID Name Item1 Item2 .....
1 abc A001 A002
2 def B001 B002