how to get top two salaries from employee tables
Answers were Sorted based on User's Feedback
Answer / rituparna
select salary from (select salary from emp order by salary
desc)
where rownum < 3;
| Is This Answer Correct ? | 10 Yes | 3 No |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
what is the path for test director,where the test cases are stored ?
what is test plan
Enlist types of testing performed for any window in sequence?
Hi harish n Satish...thanx for the response... Already told Functionality testing and user interface type testing to interviewer but he was expecting something else. And also explained test cases....Is it data driven testing for user id and password combinations? If i am not wrong....?
What tool do you use in mobile testing?
Test cases for Recycle Bin
IN V-Model, from where a tester involves and from where a developer will involve???
Why did you choose the Software Testing Field?
what is the diffrence b/w QA and QC?
when we enter wrongpaasword and wrong userid in login page and click on ok.it did not display that error msg. it displays that which page we want. what type of testing is this 1)functional testing 2)security testing
Who Decide Severity And Priority ?
12 Answers British Telecom BT,
Explain crud testing.