|
If I have the following query: Column1 || Column2 ValueA || ValueX ValueA || ValueY ValueB || ValueX ValueB || ValueY ValueB || ValueZ And I want to turn the second column into
a list, while keeping the first column unique - like so: Column1 || Column2 ValueA || ValueX, ValueY ValueB || ValueX, ValueY,
ValueZ Is there a more efficient way to do this
than: <cfoutput query="QueryXXX"
group="Column1"> <!---
populate groups list ---> <cfoutput> <cfset
ColumnToList=listappend(ColumnToList,Column2) /> </cfoutput> <!---
add row to final query ---> <cfscript> queryaddrow(FinalQuery); querysetcell(FinalQuery,'Column1',
Column1); querysetcell(FinalQuery,'Column2',
ColumnToList); </cfscript> </cfoutput> I’m sure there’s a million
ways to do this… Baz You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected] |
- [CFCDev] Query: Turn column into a list Baz
- Re: [CFCDev] Query: Turn column into a list Barney Boisvert
- Re: [CFCDev] Query: Turn column into a list Cliff Meyers
- RE: [CFCDev] Query: Turn column into a list Baz
- Re: [CFCDev] Query: Turn column into a li... Barney Boisvert
- Re: [CFCDev] Query: Turn column into... Patrick Branley
- Re: [CFCDev] Query: Turn column ... Jeff Peters
- Re: [CFCDev] Query: Turn column into a list PCC
- Re: [CFCDev] Query: Turn column into a list Barney Boisvert
- RE: [CFCDev] Query: Turn column into a list David Harris
