Jump to content

Recommended Posts

Posted

 

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??

  • Replies 35
  • Created
  • Last Reply

Top Posters In This Topic

  • chandra916

    16

  • mettastar

    9

  • Vinuu

    8

  • electionszindabad

    3

Popular Days

Top Posters In This Topic

Posted

ename daggara error vasthundi not a group by xpression ani

mee table lo column for emp_name leka inka emaina chudandi

Posted

how can you group by EMP_ID if you want max salary of Dept??

marchipoya...nice catch

Posted

mee table lo column for emp_name leka inka emaina chudandi

nee query thappuu...

Posted

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

 

×
×
  • Create New...