List:General Discussion« Previous MessageNext Message »
From:Vikram Vaswani Date:January 26 2009 12:01pm
Subject:Help with formatting of 1:n relationship
View as plain text  
Hello all

I have a database with a 1:n relationship as follows:

Item (1)
----
fld1
fld2
...

Item_info (n)
---------
fld1
fld2
...

My client wants me to export these linked records into an Excel file in 
the following format.

item.fld1 item.fld2 ... item_info.fld1 item_info.fld2 ... 
item_info.fld1 item_info.fld2 ..

ie. each item and all the records that make up its info together in a 
single Excel row.

I'm using an excel library that accepts a SELECT as input and generates 
an XLS file with the records as output. I'd like to use this where 
possible. However I don't know if it's possible to write a SELECT that 
compresses a 1:n relationship into a single row. Is this possible, and 
if yes, could someone show me how? Or could you suggest another way in 
which I could achieve the above required output?

Thanks,

Vikram

-- 
Operator: "So what do you need? Besides a miracle."
Neo: "Guns. Lots of guns."
     -- The Matrix
Thread
Help with formatting of 1:n relationshipVikram Vaswani26 Jan
  • RE: Help with formatting of 1:n relationshipJerry Schwartz26 Jan
    • Re: Help with formatting of 1:n relationshipVikram Vaswani26 Jan
      • Re: Help with formatting of 1:n relationshipBaron Schwartz26 Jan
        • Re: Help with formatting of 1:n relationshipVikram Vaswani26 Jan
        • Re: Help with formatting of 1:n relationshipClaudio Nanni27 Jan
          • Re: Help with formatting of 1:n relationshipWalter Heck27 Jan
      • RE: Help with formatting of 1:n relationshipJerry Schwartz26 Jan