how to get top two salaries from employee tables

Answers were Sorted based on User's Feedback



how to get top two salaries from employee tables..

Answer / rituparna

select salary from (select salary from emp order by salary
desc)
where rownum < 3;

Is This Answer Correct ?    10 Yes 3 No

how to get top two salaries from employee tables..

Answer / maruti

select max(sal)
from emp
where sal < (select max(sal) from emp);

with this query u ll get second largest sal of that table
if u want to know max (sal) then it ll be...
select Max(sal)
from emp;

Is This Answer Correct ?    4 Yes 0 No

how to get top two salaries from employee tables..

Answer / varu

This will be right answer for the query

Select * from empsal e where 2<=(select count(*) from empsal f
where e.sal>f.sal) order by sal desc

Is This Answer Correct ?    4 Yes 0 No

how to get top two salaries from employee tables..

Answer / charan

hi this is charan,
select e1 *from employees e1
where 2>
( select column(distincte2.sal)
where e2.sal>e1.sal )

Is This Answer Correct ?    4 Yes 1 No

how to get top two salaries from employee tables..

Answer / shiva - e-softsys

SELECT MIN (SALARY) FROM EMP WHERE

SALARY IN (SELECT DISTINCT TOP 2 SALARY FROM EMP ORDER BY
SALARY DESC)

Is This Answer Correct ?    4 Yes 1 No

how to get top two salaries from employee tables..

Answer / usha

select top 2 salary from employee order by desc

Is This Answer Correct ?    3 Yes 1 No

how to get top two salaries from employee tables..

Answer / rajendra prasad reddy penumall

this is a SQL query

SELECT DISTINCT salary FROM employee WHERE(max(salary))

Is This Answer Correct ?    3 Yes 3 No

how to get top two salaries from employee tables..

Answer / satya

Hi,

Select * from emp e where 2>=(select count(*) from emp e
where sal>e.sal) order by desc sal.

Let me know if this query is wrong.

Is This Answer Correct ?    2 Yes 2 No

how to get top two salaries from employee tables..

Answer / sivaprasad

SELECT MIN(SALARY) FROM EMP WHERE SALIN(DISTINCT TOP2
SALARY FROM EMP ORDER BY SALARY DESC.

OR
SELECT TOP 2 SALARY FROM EMP ORDER BY SALARY DESC.

Is This Answer Correct ?    2 Yes 2 No

how to get top two salaries from employee tables..

Answer / varu

writing this way is also correct

select sal
from empsal
where id > 2
order by sal desc

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Manual Testing Interview Questions

I have one doubt in regression testing, Example if we have five modules such as 1,2,3,4,5. If we made change in 3 module only and also 3 module will interact with only 1 and 5 module. For this case we will conduct testing in all module (or) only 1 and 5 module?? Answer soon firends

6 Answers  


What is the difference between baseline and traceability matrix?

0 Answers  


Can anyone tell me the test scenario for railway reservation online booking. I need all test scenario.... please friends help me.

1 Answers   Accenture,


What is the diff. between Sanity , smoke and ad-hoc testing?

8 Answers  


What is testing life Cycle and Explain different phases?

3 Answers   Covansys,






wht is bug, deffect,issue,error

5 Answers  


hi,I want to learn testing concepts. But, actually, at least, I don't have basic knowledge about testing. but, my desire is to learn testing concepts. But, I don't know, which material is good?And which site is good to learn testing concepts. Please, could any one help me regarding this? If any one have good material with you, with out feel, kindly forward that material to me? Please, do this help for me. Thanks in Advance. my mail id is gopimanchella@gmail.com BEST REGARDS M.MurthySharma.

7 Answers  


what is the diffn betn web based application and client server application

3 Answers   Hoch Technologies,


Give me different methodologies used in testing?

4 Answers   Cap Gemini,


what is the use case and what is the test case?

6 Answers   Avis Software,


what is the severity we give. login fails eventhough we enter the correct username and pwd.

9 Answers   Swathi Soft,


how do we update the test cases if the requirements change in manual testing. if we r not using quality center. depending on the changed requirements do i need to write a new test case or can we update the old test case.basically i want to update i dont want to write a new test case. so plzzzzzz answer.

5 Answers  


Categories