Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a query to find second highest salary of an employee.

Answers were Sorted based on User's Feedback



Write a query to find second highest salary of an employee. ..

Answer / p

select ename from emp where esal=(select max(esal) from emp
where esal<(select max(esal) from emp));

Is This Answer Correct ?    0 Yes 2 No

Write a query to find second highest salary of an employee. ..

Answer / satish

select e1.* from emp where 1=(select e2.sal from emp e2
where e2.sal>e1.sal)

Is This Answer Correct ?    0 Yes 2 No

Write a query to find second highest salary of an employee. ..

Answer / kapil deep

SELECT * FROM (SELECT * FROM emp_t WHERE ROWNUM < 3 ORDER
BY salary) WHERE ROWNUM < 2

above query work fine for oracle.

Taking 3 as N give u 3-1=2 i.e 2nd highest
4-1=3 gives u 3rd highest

Is This Answer Correct ?    0 Yes 2 No

Write a query to find second highest salary of an employee. ..

Answer / deepak falke

3rd highest sal from account :

SELECT TOP 1 Sal FROM account WHERE Sal IN
(SELECT distinct TOP 3 Sal FROM account ORDER BY Sal DESC)
order by sal

Is This Answer Correct ?    0 Yes 2 No

Write a query to find second highest salary of an employee. ..

Answer / vidhya

select max(column name) from table_name where((select max
(column name) from table_name Order by salary Desc) set
difference (select max(column name))

Is This Answer Correct ?    2 Yes 5 No

Write a query to find second highest salary of an employee. ..

Answer / krishna kishore

SELECT TOP 1 Salary FROM Employee WHERE Salary IN
(SELECT TOP 2 Salary FROM Employee ORDER BY Salary DESC)

I think this would be the simplest way and high performance
query.

waiting for the comments !!!

Is This Answer Correct ?    7 Yes 11 No

Write a query to find second highest salary of an employee. ..

Answer / muralidhara(minchu)

Select * from epm A where &(n-1)=(select count(*) from emp
B where A.sal < B.sal);

Try this it will work,this will give nth salary ie if u
enter 2 this will give second highest sal

Is This Answer Correct ?    13 Yes 22 No

Write a query to find second highest salary of an employee. ..

Answer / sridhar

Its real simple. Suppose your employees are in a table
called by the same name, and the salaries in a column named
salaries). Lets See te case in which we want the 3 greatest
salaries. Then you Query:

SELECT employees.salary
FROM employees
ORDER BY employees.salary desc
LIMIT 3;

If you want the biggest 5 salaries, you put LIMIT 5, and so on….

Is This Answer Correct ?    3 Yes 16 No

Write a query to find second highest salary of an employee. ..

Answer / krishna

select sal from empa where 1=(select count of sal from emp
b)where a.sal<b.sal

Is This Answer Correct ?    9 Yes 25 No

Write a query to find second highest salary of an employee. ..

Answer / gokulapriya

select * from employee where salary < (select max(salary)
from employee)
(i have written as sub query)
is this right

Is This Answer Correct ?    5 Yes 31 No

Post New Answer

More Automation Testing AllOther Interview Questions

Explain me what is the difference between setspeed() and sleep() methods?

0 Answers  


Tell me which web driver implementation is the fastest?

0 Answers  


ihave one doubt in manual testing? what is the testing process

1 Answers   DELL,


what is meant by keyboard driven test?

3 Answers  


Hi all, Do anyone have the experience in PDF Document Automation using OLE objects and methods? If so suggest the best websites for source. Thanks :-)

0 Answers  


On what basis we select test cases to automate?

1 Answers  


what is the difference or comparison between QTP and rational? and which tool is better to use?

1 Answers  


Does the Jmeter will generate any scripts? and anybody suggest with an example. how to use the Jmeter tool and also the How to anayse the Results?

2 Answers  


hi to all, if we open a browser(for ex. yahoomail.com) using navigate command. the cursor by default focussing on the 'yahoo id' html edit box. how to get the label(ie.,yahoo id) of that html edit box using descriptive program. here we should not use identify tool to get the property,thtml editbox method. by tracing the cursor position we have to get the label name. is it possible? please let me know.

0 Answers  


i have one answer from you that today the test cases are not stored in the database(SQL server 2005). But in automation testing where does the test case store? plz tell me... i have more confusion

0 Answers  


Is software requirement specification for developer and tester is same?

1 Answers  


What are the main attributes of test automation?

3 Answers   ATS, HCL,


Categories