How can I create a view with self referencing table and a cyclic condition?
SELECT *
    FROM tbl a
    WHERE deleted IS NULL
      AND EXISTS ( SELECT * FROM tbl 
                       WHERE id = a.parent_id
                         AND deleted IS NULL );


See if that works, then turn it into a VIEW.