<!--- Retrieve Expense Descriptions from Expense table; --->
<!--- This query may include any repeated descriptions  --->
<CFQUERY NAME="GetExp" DATASOURCE="#REQUEST.DataSource#">
  SELECT Description
  FROM Expenses
  ORDER BY Description
</CFQUERY>

<!--- Retrieve Expense Descriptions from Expense table; --->
<!--- The DISTINCT means we won't get any repeated rows --->
<CFQUERY NAME="GetUniqueExp" DATASOURCE="#REQUEST.DataSource#">
  SELECT DISTINCT Description
  FROM Expenses
  ORDER BY Description
</CFQUERY>

<HTML>
<HEAD><TITLE>Film Expenses</TITLE></HEAD>
<BODY>
<H2>What Are We Spending Money On?</H2>

<TABLE BORDER="1">
  <TR VALIGN="Top">
    <!--- First, ordinary SELECT records --->
    <TD>Ordinary SELECT statement:
      <OL>
      <CFOUTPUT QUERY="GetExp">
        <LI>#GetExp.Description#</LI>
      </CFOUTPUT>
      </OL>
    </TD>
    <!--- Now the SELECT DISTINCT records --->
    <TD>SELECT DISTINCT statement:
      <OL>
      <CFOUTPUT QUERY="GetUniqueExp">
        <LI>#GetUniqueExp.Description#</LI>
      </CFOUTPUT>
      </OL>
    </TD>
  </TR>
</TABLE>

</BODY>
</HTML>