I'm going to be creating a printed report for the users using a report
writing application (developed in-house by me, so I could,at some point,
change it to do more t han it does, but there are only so many hours in a
day)
 
The table structure is not under my control; it's a legacy table structure
from our mainframe and my suggestion that we change the table structure in
the move was...urm...not accepted.  
 
The output report will be something like
 
=============================
HEADER INFORMATION:  Name
                     Address
 
Key   Value
----  -------
KEY   Attrib
KEY   Attrib
KEY   Attrib
      -------
Total Attrib-total
=============================
 
Significantly more complex than that, but in general, that's how  it should
work.  

-
Dave Weingart, Sr. Programmer/Analyst    "I can call modules from the vasty
Private Label Services                    deep." -- "Why, so can I, or so
can
Voice: +1-516-682-1470                    any programmer.  But will they run
FAX  : +1-516-496-3160                    when you do call for them?" 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 7:18 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Breaking table columns into separate rows



When you say "report" what exactly do you mean? In the client., have you
looked at using \G and not ; to terminate your queries? 

Why not transform your data structure and keep only one column of data, as
you suggested? 

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine 


[EMAIL PROTECTED] wrote on 09/10/2004 10:11:05 AM:

> I have a table that has a structure similar to this
> 
> | KeyField  | Attrib1 | Attrib2 | Attrib 3 |
> 
> What I need to do for a report that I need to generate is break this into
> multiple rows, as
> 
> | KeyField  | Attrib1 |
> | KeyField  | Attrib2 |
> | KeyField  | Attrib3 |
> 
> Key field is not unique, and obviously I'd prefer if the result table was
> actually
> 
> | KeyField  | Attrib |
> 
> so that I can suppress rows where Attrib contains no data.
> 
> I can think of several ways to do this, but they're all too convoluted for
> the system we're using here.  Ideally, it should be in a single SELECT
> statement.  I've tried subqueries and temporary tables but I've been
unable
> to make this work.
> 
> Any pointers that anyone can give me?
> 
> --
> Dave Weingart, Sr. Programmer/Analyst    "I can call modules from the
vasty
> Private Label Services                    deep." -- "Why, so can I, or so
> can
> Voice: +1-516-682-1470                    any programmer.  But will they
run
> FAX  : +1-516-496-3160                    when you do call for them?"
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 


Reply via email to