this should work fine:

PHP Code:
select student_id from (
   
select distinct student_id,
      
count(*) over (partition by student_idcourses
   from my_table
   where course in 
('java','c'))
where courses 2