> I have a query which has static as well as dynamic columns. something like > below: > > <cfset vMarks = "marks1, marks2, marks3"> > <cfquery name="querymarks" datasource = "abc"> > > SELECT firstname, lastname, > <cfloop from="1" to="listlen(vMarks)" index="index"> > marks_#index# <cfif #index# NEQ listlen(vMarks)>,</cfif> > </cfloop> > </cfquery> > > The query result set will look like below: > > firstname lastname marks1 marks2 marks3 ... > abc abc 112 113 114 > def def 121 122 123
This is a denormalized (and therefore usually bad) database schema. You should have a separate table for marks, and join that to people. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334384 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

