SELECT LAST_NAME AS "Last Name",DEPARTMENT_ID AS "Department Id",SALARY AS Salary FROM EMPLOYEES JOIN DEPARTMENTS USING(DEPARTMENT_ID) WHERE SALARY IN (SELECT MIN(SALARY) FROM EMPLOYEES GROUP BY DEPARTMENT_ID,SALARY ORDER BY DEPARTMENT_ID);
订购在条件中使用的子查询的结果是没有意义的.
除此之外,您可能只想通过dept_id进行分组(为什么还有薪水呢?这没有意义).