I have this query on MS SQL 2005
SELECT tbl_category.catname, sum(tbl_answered_questions.points) as points
FROM tbl_answered_questions, tbl_question, tbl_category
WHERE tbl_answered_questions.qid = tbl_question.qid
AND tbl_question.catid = tbl_category.catid
AND tbl_answered_questions.uid = 2
GROUP BY tbl_category.catname
|
on the MS SQL Management Studio works fine, but when I try to display on the cfoutput I get the wrong output. I get 4
but since I group I should get
Group 1: 0
Group 2: 2
Group 3: 2
Here is my output
<cfoutput query="qryGetPoints">
<tr>
<td width="14%" height="10" class="myaccount2">#points#</td>
<td width="86%" height="10" class="myaccount3"></td>
</tr>
</cfoutput>
|