Not sure if this is exactly what you are looking for, but it will display your table in the format you requested. Hope this helps. This should be pretty fast.
-- Sam <cfquery name="test" datasource="#mydatsource#"> select * from my_table order by foreign_id, value </cfquery> <cfset fid_holder=0> <table border="0"><tr> <cfoutput query="test"> <cfif fid_holder neq foreign_id> </tr><tr><td>#foreign_id#</td> </cfif> <td>#value#</td> <cfset fid_holder=#foreign_id#> </cfoutput> </tr></table> -----Original Message----- From: Timothy Heald [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 6:49 AM To: CF-Talk Subject: SQL Question Hey folks, I have a table like this: id foreign id value 1 1 1 2 1 2 3 1 3 4 2 1 5 2 2 6 2 3 Regular old normalized table right? Well I need to get it into columns like this: foreignID value1 value2 value3 1 1 2 3 2 1 2 3 Now I know it is possible, but difficult. I would do it with CF but no matter how high I set the time out in my administrator, and my web server it times out, or says page cannot be displayed. It is pulling huge amounts of data, then outputting it it an Excel spread sheet. We tried to do it with a DTS package and the use SQL Mail to send it, but couldn't get that to work reliably. TIA. Tim Heald ACP/CCFD :) Application Development www.schoollink.net ______________________________________________________________________ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists