Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Before you can count the number of groups by
<cfset groupCount = ListLen(ListRemoveDuplicates(valueList(query.name)))>
Copy link to clipboard
Copied
To generate the row-count, you could use a query-of-query, which is effectively CFML code. Irrespective of how you output the row-data.
Here is a quick example, using ColdFusion's in-built cfdocsexample datasource:
<cfquery name = "GetCourses" dataSource = "cfdocexamples">
SELECT*
FROM courseList
</cfquery>
<cfdump var="#GetCourses#" label="GetCourses">
<p>
<cfquery name = "GetCourseIDs" dbtype="query">
SELECT distinct(Dept_ID)
FROM GetCourses
</cfquery>
<cfoutput>Number of departments (DEPT_ID): #GetCourseIDs.recordcount#</cfoutput>
</p>
<p>
<cfquery name = "GetCourseLevels" dbtype="query">
SELECT distinct(CorLevel)
FROM GetCourses
</cfquery>
<cfoutput>Number of Course Levels (CORLEVEL): #GetCourseLevels.recordcount#</cfoutput>
</p>