I am not sure about how the query in the attached document helps you achieve desired functionality but I felt the usage of EXISTS clause is not properly formed in your case.
The query with EXISTS clause is called Correlated subquery and it is called so because at least a single join condition is based/dependent upon parent query. consider example below.
SELECT * FROM emp e
WHERE EXISTS ( SELECT 1 FROM Dept d WHERE d.dept_id = e.dept_id);
Similarly you need to identify and include a join condition in your correlated query which refers parent query column (e.dept_id) as in the example above.