Maybe not the most efficient way but you can loop through the GetCategories
query and within each iteration of the loop get the associated product count
using another query.
Not tested but this should work:
<cfloop query="GetCategories">
<cfquery name="GetProducts" datasource="XYZ">
SELECT Products.ID, Products.CATEGORY
FROM products
WHERE Products.CATEGORY = #GetCategories.Categories.ID#
</cfquery>
<cfoutput>GetCategories.CATEGORY ( #GetPorducts.RecordCount # )</cfoutput>
</cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349225
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm