Guest User

Untitled

a guest
Jan 24th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. select name from employees
  2. where managerId in (select id from employees)
  3. or (managerId is null and id not in (select managerId from employees where managerId is not null))
  4. or 0 = (select count(id) from employees where managerId is not null)
Add Comment
Please, Sign In to add comment