select employee_no,salary,manager_no from
(select a.employee_no,a.salary,a.manager_no,b.salary manager_salary
from 你的表名 a left outer join 你的表名 b on a.manager_no = b.employee_no) ss
where salary > manager_salary

解决方案 »

  1.   

    select a.employee_no,a.salary
    from MyTable a
    where a.manager_no is not null
    and a.salary >(select b.salary from MyTable b
                    where b.employee_no = a.manager_no);
      

  2.   

    select t1.employee_no, t1.salary, t2.salary from table1 as t1,table1 as t2 where t1.manager_no = t2.employee_no and t1.salary>t2.salary
      

  3.   

    select t1.* from table1 as t1,table1 as t2 where t1.manager_no = t2.employee_no and t1.salary>t2.salary