select t.ID, t.Name
from
(
select ID,Name,Salary,上级ID
from table
where 上级ID is not null
) t join(
select ID,Salary
from table
) s on t.上级ID = s.ID
where t.Salary > s.Salary