|
- SELECT department_id, employee_id, salary
- FROM EMPLOYEES e
- WHERE 1 =
- (SELECT COUNT(DISTINCT salary)
- FROM EMPLOYEES
- WHERE e.department_id = department_id
- AND e.salary <= salary);
-
-
- select a.department_id, e.employee_id , e.salary
- from
- (select department_id, max(salary) maxsal
- from employees
- group by department_id) a , employees e
- where a.department_id =e.department_id
- and a.maxsal=e.salary ;
复制代码
|
|