查找财务部年龄低于开发部员工年龄的员工的姓名。select name from employees where  birthday in (select birthday from employees where departmentid in (select departmentid from departments where departmentname = '财务部'))
and ((select birthday from employees where departmentid in (select departmentid from departments where departmentname = '财务部'))
 >all  (select birthday from employees where departmentid in (select departmentid from departments where departmentname = '开发部')))

解决方案 »

  1.   

    问题本身就有BUG
    查找财务部年龄低于开发部员工平均年龄的员工的姓名。
    查找财务部年龄低于开发部员工最高年龄的员工的姓名。
    查找财务部年龄低于开发部员工最低年龄的员工的姓名。
      

  2.   


    select name from employees where  birthday in (select birthday from employees where departmentid in (select departmentid from departments where departmentname = '财务部'))
    and birthday >all  (select birthday from employees where departmentid in (select departmentid from departments where departmentname = '开发部'))
    改好了,这样好像可以了