[snip 1]
You could do that for the RecordID if you do not know what they are (I
knew what RecordID's existed, so I could specifiy an IF statement for each).
If I remember correctly you could even have SQL produce do the code for you.
In PHP you could do it any number of ways (pseudocode follows -
uot;, and get it all done at
once, right?
Andrew Hazen
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 02, 2002 9:47 AM
To: 'Andrew Hazen'; [EMAIL PROTECTED]
Subject: RE: [thelist] MySQL to Excel Problem Pivot Table SOLVED!
[snip]
Fascinat
[snip]
Fascinating. But how do you build the SELECT? Seems to me you would
first have to "SELECT RecordID FROM tblClass10" and then script an
iteration to build the whole series of IF clauses. Or did I miss
something?
[/snip]
You could do that for the RecordID if you do not know what they are
PROTECTED]]
Sent: Wednesday, May 01, 2002 5:16 PM
To: Jay Blanchard; [EMAIL PROTECTED]
Subject: Re: [thelist] MySQL to Excel Problem Pivot Table SOLVED!
Ahh, the joy of cross-tabulation. Whee. :)
Jay Blanchard wrote:
>
> Sorry for the cross-post, both lists contributed to a solution. H
> Nothing needs to be done in PHP
> except run this query and place the results.
>
> I feel like rudy today! :)
thanks, i'm honoured
especially since your comment comes right after
"nothing needs to be done except run this query"
that is indeed the holy grail of web development -- ask the dat
Ahh, the joy of cross-tabulation. Whee. :)
Jay Blanchard wrote:
>
> Sorry for the cross-post, both lists contributed to a solution. Here is a
> query (using MySQL 3.23) that will return cross tab, or pivot table
> information;
>
> mysql> select RecordDate,
> -> IF(RecordID='100101',count(*
[snip]
SELECT RecordID, RecordDate, count(*) AS Quantity
FROM tblFOO
Group By RecordID, RecordDate
It returns;
+--++--+
| RecordID | RecordDate | Quantity |
+--++--+
| 100101 | 2002-03-21 | 6675 |
| 100101 | 2002-03-22 | 6794 |
|