Actually a reposting/rephrase of an earlier question...
I'm still trying to count categories..


For each distinct instance of column A, how many distinct instances of
column B are there...

Should I use a compound query (not legal SQL):

Select DISTINCT Column_A from TABLE_A
       Select DISTINCT Column_B from TABLE_A

...or a loop

Query_A gets the distinct Column A records, and then:

<cfloop query="query_A">
   <cfquery name="query_b">
     Select DISTINCT column_B
     WHERE column_A = "#Query_A.column_A">
   </cfquery>

...cfset record count here for each....

</cfloop>


...or is there a much better way to handle something like this?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to