using case when with count and partition by functions in an oracle query
Posted on 2016-09-29
I hope this makes sense.
I need to count 1 for each student who has a particular attendance code at least once.
I wrote the following statement but it doesn't seem to work as expected, I assume I'm not using the correct logic. Can anyone help?
CASE WHEN Attendance_Code.Att_Code in ('HB') AND STUDENTS.grade_level = '12' THEN count(*) over (partition by students.student_number) end "12"