I have a query result as followed:
ID, STATE, ARTICLE
1 AK bug
1 AK plant
1 CA bug
1 CA plant
2 NY fly
.
.
how to do I output the STATE column output when it's a multi-state and separate each state by a comma? i want to output like this:
STATE ARTICLE
AK, CA bug
plant
NY fly
.
.
here is i got so far:
<cfset tmpID="">
<table>
<cfoutput query="myQuery" group="ID">
<cfoutput group="STATE">
<tr>
<td>#STATE#</td>
<td><cfif tmpID NEQ myQuery.ID>#ARTICLE#</td>
</tr>
<cfset tmpID = myQuery.ID>
</cfoutput>
</cfoutput>
but i got this
STATE ARTICLE
AK bug
plant
CA
NY fly
.
.