mettastar Posted May 15, 2014 Report Posted May 15, 2014 SELECT EMPLOYEE_ID, DEPT_ID, EMPLOYEE_NAME, MAX(SALARY) MAX_SALARY FROM EMPLOYEES WHERE DEPT_ID IN 10,20 GROUP BY EMPLOYEE_ID,DEPT_ID how can you group by EMP_ID if you want max salary of Dept??
Vinuu Posted May 15, 2014 Report Posted May 15, 2014 ename daggara error vasthundi not a group by xpression ani mee table lo column for emp_name leka inka emaina chudandi
Vinuu Posted May 15, 2014 Report Posted May 15, 2014 how can you group by EMP_ID if you want max salary of Dept?? marchipoya...nice catch
mettastar Posted May 15, 2014 Report Posted May 15, 2014 mee table lo column for emp_name leka inka emaina chudandi nee query thappuu...
chandra916 Posted May 15, 2014 Author Report Posted May 15, 2014 mee table lo column for emp_name leka inka emaina chudandi ename ani vundhi...anyways I got the answer...i poste the quesry also select ename,sal,deptno from emp where sal in(select max(sal) from emp where deptno in (10,20) group by deptno); ENAME SAL DEPTNO ---------- ---------- ---------- SCOTT 3000 20 KING 5000 10 FORD 3000 20
Recommended Posts