Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select name from employees
- where managerId in (select id from employees)
- or (managerId is null and id not in (select managerId from employees where managerId is not null))
- or 0 = (select count(id) from employees where managerId is not null)
Add Comment
Please, Sign In to add comment