karatekid36 Posted November 30, 2011 Share Posted November 30, 2011 With the below query, it returns the MIN salary for each department, but what if you want to list the EMP_ID or EMP_NAME in this list as well? Meaning you want to see the EMP_ID in the department that has the MIN(salary). Won't that end up expanding the returns to more or less all rows? SELECT department, MIN(salary) as "Lowest salary" FROM employees GROUP BY department; Thanks! Link to comment https://forums.phpfreaks.com/topic/252129-issue-with-min-and-group-by/ Share on other sites More sharing options...
fenway Posted November 30, 2011 Share Posted November 30, 2011 Then you need a self-join. Link to comment https://forums.phpfreaks.com/topic/252129-issue-with-min-and-group-by/#findComment-1292757 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.