Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crosstabs help in Cold Fusion

Status
Not open for further replies.

brettco

Programmer
May 7, 2014
1
US
I found one post on here about crosstabs (with a broken link to an article ( however some of the information is missing, so let me start from the beginning.

I am trying to group by teacher. Rows will be grade, columns will be course and the cross rows/columns will be number of students in each grade/course. Last column will be total.

i.e. (sorry that the columns do not align)
Teacher
|Math|Science|English|Total
Grade 1| 3 | 2 | 2 | 7
Grade 2| 0 | 1 | 8 | 9

All data is dynamic. The simplified query without any crosstab work done is:

SELECT teacher,course,grade,count(studentid) as studentcount
FROM teachers

Thanks for the help!

BrettCo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top