Hi,
I need to query a master and detail table but returns records in on result set with each row containing the header plus a field for each detail. i.e.
MasterTable
Record1-Field1-Field2
DetailTable
Record1-Field1
Record2-Field1
Record3-Field1
The two tables are linked with an integer ID. I need to return for each master record the following:-
ResultRecord-MasterField1-MasterField2-DetailRecord1Field1-DetailRecord2Field1-DetailRecord3Field1
Any help would be appreciated as I'm quite new to this.
regards,
Simon.

How To !! - Query Master Detail tables and return flat result set
LEOJZAMBONI
Thank you for the reply. My problem is slightly different though than that example.
I need to join a master table with multiple records from the detail table returning only one record containing the master table fields and all the detail fields for each detail record.
MasterTable
ItemID
MasterText
DetailTable
ItemID
DetailText
Assuming DetailTable is linked to MasterTable on ItemID and there are multiple detail records, I need to return the following result.
ItemID, MasterText, DetailRecord1.DetailText, DetailRecord2.DetailText .......
rather than the normal:-
ItemID,MasterText,DetailRecord1.DetailText
ItemID,MasterText,DetailRecord2.DetailText
......
regards,
Simon.
Tore Birkeland
Post your table DDL, some sample data & expected result.
js12
Robert U
Henrik Andre Tellevik