Coldfusion 如何使用cfoutput group by date输出表格结果?

Coldfusion 如何使用cfoutput group by date输出表格结果?,coldfusion,cfoutput,Coldfusion,Cfoutput,我有一个查询,用于获取表中所有员工的计数: emp_namelast | emp_namefirst | employeetotal | year_cse1 -------------------------------------------------------- smith | john | 13 | 2014 smith jr | jonnny | 10 |2014 baker

我有一个查询,用于获取表中所有员工的计数:

emp_namelast | emp_namefirst | employeetotal | year_cse1
--------------------------------------------------------
smith        | john          | 13            | 2014
smith jr     | jonnny        | 10            |2014
baker        |jane           |5              |2015
doe           |john           |6             |2015
我将结果输出到一个表中。我有查询结果的顺序。 但下面的代码将输出2014年的最高结果,然后是最高结果 2015年的结果

我尝试过使用no-group,它提供了查询中的所有数据。 我希望它在两个不同的表格中输出2014年和2015年的数据。 其中一个将包含2014年和2015年的记录

是否必须在不使用“组”的情况下完成

<h2>employees</h2>

<table >
    <thead><tr><th>Employee</th><th>Stars</th></tr></thead>
    <tbody> 
        <cfoutput query="GetEmployeeTotals" group="year_cse1">  
            <tr><td>#emp_namefirst# #emp_namelast#</td>
                <td>#employeetotal#</td>
            </tr>   
        </cfoutput>
    </tbody>
</table>
员工
雇员之星
#emp#u name first##emp#u name last#
#雇员总数#

您的思路正确,但缺少一个细节。“组”属性的工作方式如下:

<cfoutput query="somequery" group="somefield">
grouped data goes here

<cfoutput>
ungrouped data goes here
</cfoutput>
grouped data can go here as well
</cfoutput>

分组数据放在这里
未分组的数据放在这里
分组数据也可以放在这里
在代码中,您没有输出任何分组数据,并且缺少未分组数据的额外cfoutput标记。

NB:“分组”功能需要排序的查询数据。为了使以上各项正常工作,sql查询还必须按
somefield