Getting child course users who may have been disabled when the parent course id was passed in to SIS

SELECT course_id, user_id
FROM [BBLEARN].[dbo].[course_users] child
JOIN [BBLEARN].[dbo].[course_users] parent on parent.child_crsmain_pk1 = child.crsmain_pk1 and parent.users_pk1 = child.users_pk1
JOIN [BBLEARN].[dbo].[course_main] on child.crsmain_pk1 = [BBLEARN].[dbo].[course_main].pk1
JOIN [BBLEARN].[dbo].[users] on [BBLEARN].[dbo].[users].pk1 = child.users_pk1
where child.available_ind = ‘N’ and parent.child_crsmain_pk1 is not null