Monday, August 31, 2015

Fetch the record from employee, department, salary (min/max)

select e.FIRST_NAME, d.DEPT_NAME, min(s.salary), max(s.salary)
from EMPLOYEE e
INNER JOIN DEPARTMENT d  
on e.ID = d.EMP_ID
INNER JOIN SALARY s
on e.ID = s.EMP_ID
WHERE e.ID = '1' GROUP BY e.FIRST_NAME, d.DEPT_NAME;

with out group by na “not a single-group group function” while using min, max

No comments:

Post a Comment