[![enter image description here](https://i.stack.imgur.com/ueBeZ.png)](https://i.stack.imgur.com/ueBeZ.png)

I want to get all user records who have completed one course and appear in another course with `Isactive = 'N'`. 

Like below

[![enter image description here](https://i.stack.imgur.com/xEm65.png)](https://i.stack.imgur.com/xEm65.png)