<!---
Name:        ratings1.cfm
Author:      Ben Forta (ben@forta.com)
Description: Query output grouping
Created:     4/1/01
--->

<!--- Get movie list from database --->
<CFQUERY NAME="movies" DATASOURCE="ows">
SELECT MovieTitle, RatingID
FROM Films 
ORDER BY RatingID, MovieTitle
</CFQUERY>

<!--- Create HTML page --->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
    <TITLE>Orange Whip Studios - Movies by Rating</TITLE>
</HEAD>

<BODY>

<!--- Display movie list --->
<UL>
<!--- Loop through ratings --->
<CFOUTPUT QUERY="movies" GROUP="RatingID">
<LI>#RatingID#</LI>
 <UL>
 <!--- For each rating, list movies --->
 <CFOUTPUT>
  <LI>#MovieTitle#</LI>
 </CFOUTPUT>
 </UL>
</CFOUTPUT>
</UL>

</BODY>
</HTML>

