Retrieve distinct manager from account

In the entity Account I am storing employees and managers. One direct manager is associated with many employees. I have created an employee list based upon a certain condition Now, I want to retrieve direct manager from that filtered employee account list. How can this be done without using a loop. Can we do it using OQL?    
1 answers

In OQL distinct is possible:

though i never used it, but it may be worth a try.

Using the list operation “union” is also an option: if you union a list of managers with itself, it creates a list with unique managers.

Does this help?