how to find the first two highest salaries in deptno in emp
table

Answers were Sorted based on User's Feedback



how to find the first two highest salaries in deptno in emp table..

Answer / santhosh kandula


if u want select the second highest salary from the emp
table then u have to write query as

select max(salary) from emp where
salary < ( select max(salary) from emp )

Is This Answer Correct ?    6 Yes 1 No

how to find the first two highest salaries in deptno in emp table..

Answer / ajitnayak

select e.*
from emp e
where rownum < 3
order by e.sal desc ;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB Development Interview Questions

The count() function always returns a int value type what should you do if you need to count rows from a query which you know will return a value that is too large for an int value type?

0 Answers  


Write short notes on manual refreshes.

0 Answers  


When installing the datastage7.5x2 edtion iam getting aproblem i.e the cpu count is 2 but the cpu count in installation is one . how can i install in my p.c (system is dual core).

0 Answers  


How to use online Backups?

0 Answers  


How long can an error message be in raiseerror function?

0 Answers  






What is dbms explain in brief?

0 Answers  


What is the difference between a primary index and a secondary index? What is a duplicate data entry in an index? Can a primary index contain duplicates?

5 Answers   IBM,


What is the physical representation for a many-to-many relationship?

0 Answers  


What are the types of database model?

0 Answers  


What is DB Development software?

0 Answers  


You have a table with three columns: amount1, amount2, and amount3 in a single row only one of these three columns will have a value and the other two will be null. Write a sql query to retrieve the values from these columns?

0 Answers  


What are the 18 schemas?

0 Answers  


Categories