I need to develop a query that captures a header row and its related detail records following it. Is there a way to perform this in SQL management studio? My query is returning a header record then detail record for each detail record. I need the header record, then all the corresponding detail records.
This is my result |ClaimID|DOS|TotalAmt||ClaimID|claimline|servcode| HDR|12345E06789A1 |2011-09-08|172| DTL|12345E06789A1 |1 |A1234|
Hi--I'm working from MS management studio. And yes, the header is coming in as a row itself, I added <CR><LF> to the query so the detail would be a row after the header. What I can't get to, is to pull that header row only once. I get a header row for each detail record.