i want department wise maxmum salary and empolyee name
Answers were Sorted based on User's Feedback
Answer / sanjay pradhan
select ename,sal,deptno from emp where (deptno,sal) in
(select deptno,max(sal) from emp group by deptno);
| Is This Answer Correct ? | 15 Yes | 4 No |
Answer / ajaikumar
Select e.ename, d.deptname, e.sal
from emp e, dept d
where
e.deptno = d.deptno
and
e.sal IN (
select max(sal) from emp
group by deptno
)
| Is This Answer Correct ? | 6 Yes | 5 No |
Answer / jaber badarneh
SELECT ENAME ,SAL ,DEPTNO
FROM EMP
WHERE SAL IN (SELECT MAX(SAL) FROM EMP GROUP BY DEPTNO)
| Is This Answer Correct ? | 19 Yes | 19 No |
Answer / sanjaya
select distinct deptno, max(sal)over ( partition by deptno order by deptno) from emp;
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / sai krishna
Select * from (Select Dense_Rank() over ( Partition by department_id Order by salary desc) as Rnk,E.* from HR.Employees E) where Rnk=1;
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kk
SELECT d.DEPARTMENT_NAME,max(e.salary) from HR.EMPLOYEES e
join HR.DEPARTMENTS d
on e.DEPARTMENT_ID=d.DEPARTMENT_ID
group by d.DEPARTMENT_NAME;
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / abhisudipta
select d.dept_name,e.emp_nm,max(e.sal) as salary
from dept d, emp e
where d.dept_no=e.dept_no and e.emp_nm = (select emp_nm from
emp where sal=(select max(sal) from emp where
dept_no=d.dept_no))
group by d.dept_name,e.emp_nm;
| Is This Answer Correct ? | 6 Yes | 7 No |
Answer / satya
select empno,max(sal) sal,deptno from emp where empno in
(select e.empno from emp e where e.sal=(select max(a.sal) from
emp a where deptno=e.deptno)) group by deptno,empno;
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / shiva
select deptno,ename,max(sal)
from emp
group by deptno,ename;
| Is This Answer Correct ? | 0 Yes | 7 No |
How to recover a dropped table in oracle?
What are the benefits of ordbms?
What is the difference between a hot backup and a cold backup in oracle?
The join defined by the default data link is an outer join yes or no ?
Explain the use of rows option in imp command.
How can we Update a table with out using UPDATE command?
How do I find the database name in oracle?
how many outer joins are used in a single sql query? is there any limitations for using of outer joins?
2 Answers BOB Technologies, Cap Gemini, IBM,
interview questions with answer for cts
What are the execution control statements in oracle?
What language does oracle use?
dear sir/madam, i have done my engg in 2007 after that i did oracle course (sql,plsql,forms,reports) .from 2008 to 2009 i searched job but didnt got.so i planned to move to sales field & i gone to dubai.till now i m in sales only.now i want to shift my career in to IT industry.but now people are not hiring as fresher.so i planned put fake 1 + exp. is it good or bad or any other way is there to enter in IT.please suggest me or call me 09632087338.