mettastar Posted May 15, 2014 Report Posted May 15, 2014 ok ok...... subquery no or In-Line view no antaru.. word gurthuledu
chandra916 Posted May 15, 2014 Author Report Posted May 15, 2014 subquery no or In-Line view no antaru.. word gurthuledu inline view anukunta......chi dhenamma jeevitham anduke eeroju cheppe class notes eeroje saduvukovali ani.....lekapothe emi gurthundadu
Vinuu Posted May 15, 2014 Report Posted May 15, 2014 EMPLOYEE AND DEPARMENT ARE 2 DIFFERENT TABLES select DEP.DEPT_NO, E.EMPLOYEE_ID, DEP.DEPT_NAME, E.SAL from EMPLOYEES E inner join ( select max(E.SAL) MaxSalary,DEP.DEPT_NO,DEP.DEPT_NAME, from EMPLOYEES E inner join DEPARMENTS D on E.DEPT_NO= DEP.DEPT_NO group by DEP.DEPT_NO,DEP.DEPT_NAME ) on E.SAL= DEP.MAXSALARY and E.DEPT_NO= DEP.DEPT_NO WHERE DEP.DEPT_NO IN (10,20) order by DEP.DEPT_NO
mettastar Posted May 15, 2014 Report Posted May 15, 2014 inline view anukunta......chi dhenamma jeevitham anduke eeroju cheppe class notes eeroje saduvukovali ani.....lekapothe emi gurthundadu concept thelisthe chaalu bro.. practice cheyi manchiga ilanti exercise lu useful avuthayi and different approaches kuda thelusthayi
chandra916 Posted May 15, 2014 Author Report Posted May 15, 2014 EMPLOYEE AND DEPARMENT ARE 2 DIFFERENT TABLES select DEP.DEPT_NO, E.EMPLOYEE_ID, DEP.DEPT_NAME, E.SAL from EMPLOYEES E inner join ( select max(E.SAL) MaxSalary,DEP.DEPT_NO,DEP.DEPT_NAME, from EMPLOYEES E inner join DEPARMENTS D on E.DEPT_NO= DEP.DEPT_NO group by DEP.DEPT_NO,DEP.DEPT_NAME ) on E.SAL= DEP.MAXSALARY and E.DEPT_NO= DEP.DEPT_NO WHERE DEP.DEPT_NO IN (10,20) order by DEP.DEPT_NO deptno kuda same table lo vuntadi kadha....
Vinuu Posted May 15, 2014 Report Posted May 15, 2014 deptno kuda same table lo vuntadi kadha.... mee table structure pm cheyandi....like the columns in it
electionszindabad Posted May 15, 2014 Report Posted May 15, 2014 EMPLOYEE AND DEPARMENT ARE 2 DIFFERENT TABLES select DEP.DEPT_NO, E.EMPLOYEE_ID, DEP.DEPT_NAME, E.SAL from EMPLOYEES E inner join ( select max(E.SAL) MaxSalary,DEP.DEPT_NO,DEP.DEPT_NAME, from EMPLOYEES E inner join DEPARMENTS D on E.DEPT_NO= DEP.DEPT_NO group by DEP.DEPT_NO,DEP.DEPT_NAME ) on E.SAL= DEP.MAXSALARY and E.DEPT_NO= DEP.DEPT_NO WHERE DEP.DEPT_NO IN (10,20) order by DEP.DEPT_NO exactly... i was thinking in these terms an hence max and group by popped in my mind...
chandra916 Posted May 15, 2014 Author Report Posted May 15, 2014 mee table structure pm cheyandi....like the columns in it oracle 11g install chesinappudu deafult tables isthadu kadha EMP table adhe.....
Vinuu Posted May 15, 2014 Report Posted May 15, 2014 oracle 11g install chesinappudu deafult tables isthadu kadha EMP table adhe..... ok
chandra916 Posted May 15, 2014 Author Report Posted May 15, 2014 bookmark chesthunna thread ni.....replyes ivandi repu morning nenu try chesina thrawatha naaku vasthe na query post chestha
chandra916 Posted May 15, 2014 Author Report Posted May 15, 2014 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
Vinuu Posted May 15, 2014 Report Posted May 15, 2014 oracle 11g install chesinappudu deafult tables isthadu kadha EMP table adhe..... 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
chandra916 Posted May 15, 2014 Author 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 nenu already rasesa....naku employee name kavali
chandra916 Posted May 15, 2014 Author 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 ename daggara error vasthundi not a group by xpression ani
Recommended Posts