Outputing a query
I thought I used to be able to do this but since I have not done it for awhile I forgot how to do it.
I have a query result that looks like this:
Categories Course_Name Course_No Course_level
Language English E100001 Intro
Language English E20001 Intermediate
Language English E30001 Advance
Language Spanish S10001 Intro
Language Spanish S20001 Intermediate
Language Spanish S30001 Advance
Art Piano P11001 Intorduction
Art Piano P21001 Intermediate
Art Piano P31001 Advance
I need to output this query in a table so when user look at this table, category will only showed once:
Categories Course_Name Course_No Course_level
Language English E100001 Intro
English E20001 Intermediate
English E30001 Advance
Spanish S10001 Intro
Spanish S20001 Intermediate
Spanish S30001 Advance
Art Piano P11001 Intorduction
Piano P21001 Intermediate
Piano P31001 Advance
I used table but I can' get it right, can anyone help, thank you!!
<table>
<tr>
<td>Category</td>
<td>Course Name</td>
<td>Course Number</td>
<td>Course Level</td>
</tr>
<cfquery name="GetCourses datasource="#dsn#">
select * from program
order by category
</cfquery>
<cfoutput query="GetCourses">
<cfquery name="GetCategory datasource="#dsn#">
select distinct categorry from program
</cfquery>
<tr>
<td>#GetCategory.Category#</td>
<td>#Course_Name#</td>
<td>#Course Number#</td>
<td>#Course Level#</td>
</tr>
</cfquery>
</table>
