MySQL doesn't have any built-in pivot support. You could add this in
to MySQL, but it is probably easier to write the equivalent
functionality in CF.

The first thing that comes to mind is to loop over the result set once
to build up an alternate data structure, such as a 2-dimensional
array, then loop over that new data structure to create the output. Or
maybe use the array syntax of cfquery and instead of looping over a
query you loop over listlen(query.columnlist) and reference the
datapoints like query['firstname'][1] query['firstname'][2]...., for
the top table row.

-Mike Chabot

On Fri, Nov 7, 2008 at 10:36 PM, Pete Ruckelshaus
<[EMAIL PROTECTED]> wrote:
> Any idea how to do that in MySQL 5?
>
> On Fri, Nov 7, 2008 at 9:00 PM, Mike Chabot <[EMAIL PROTECTED]> wrote:
>> You can run a pivot command in your database query before sending the
>> results to ColdFusion so that CF receives the data in a format that
>> can be easily looped over.
>>
>> -Mike Chabot
>>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314986
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to