List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:January 26 2009 6:01pm
Subject:RE: Help with formatting of 1:n relationship
View as plain text  

>-----Original Message-----
>From: blue.trapezius@stripped [mailto:blue.trapezius@stripped] On
>Behalf Of Vikram Vaswani
>Sent: Monday, January 26, 2009 11:29 AM
>To: Jerry Schwartz
>Cc: mysql@stripped
>Subject: Re: Help with formatting of 1:n relationship
>
>Hi Jerry
>
>Thanks for your input on this!
>
>
>>> 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?
>>>
>> Does whatever tool you are using have any place where you can
>manipulate the
>> data between the SELECT and the creation of the XLS? If not,I think
>you need
>> a user-defined function for this, or perhaps you can do it with a
>> user-defined procedure.
>
>Unfortunately the tool doesn't let me manipulate the data. It simply
>reads the result set and pops each field into a separate column in the
>XLS. So any formatting I do has to be part of the SELECT.
>
[JS] There is one other possibility that occurs to me: you could use the
GROUP_CONCAT technique to get the data into Excel, and then use the Excel
"text to columns" command to do the rest of the work.

Any way you slice it, you're going to have to torture your procedures to get
your result.

>I did consider a procedure but the problem is that the client is still
>using MySQL 4.x, which afaik doesn't support stored procedures. An
>upgrade is not something they can do at this point, as they're using s
>shared host so the server isn't really under their control.
>
>Vikram
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>infoshop.com




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