I have 2 problems here.
Courses aren't grouping together. My results have the same course listed several times with different count(*) per row. Each identical course_name and course_number should be grouped into 1
I need to get the percentage of ethnicity not equal to 04 per course. So the total students.ethnicity not equal to 04 divided by the total instances of students.student_number "for each" individual course. The percentage I'm calculating in the query below only returns 0% or 100% which isn't correct.
Thanks so much!!!
count(*) as COURSE_ENROLLMENT,
ROUND(COUNT(CASE WHEN STUDENTS.ETHNICITY != '04' THEN 1 end)/ count(*) * 100) || '%' Minority
LEFT JOIN CC ON CC.STUDENTID = STUDENTS.ID
LEFT JOIN S_CT_STU_DEMOGRAPHICS_X ON STUDENTS.DCID = S_CT_STU_DEMOGRAPHICS_X.STUDENTSDCID
LEFT JOIN COURSES ON CC.COURSE_NUMBER = COURSES.COURSE_NUMBER
CC.TERMID IN ('2600','2601','2602')
AND STUDENTS.SCHOOLID IN ('61', '62')
AND STUDENTS.ENROLL_STATUS = 0
AND COURSES.GRADESCALEID in (110,123)
ORDER BY CC.COURSE_NUMBER