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 / rajkumar mandala

select sal from
(select sal,(row_number() over (order by sal)) N from emp ) y where N= {value}

Replace {value} value with required highest value.
ie, 2 for 2nd highest

Is This Answer Correct ?    7 Yes 3 No

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

Answer / aj

select * from emp A where 1=(select count(*) from emp B
where A.SALARY < B.SALARY)

Is This Answer Correct ?    12 Yes 9 No

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

Answer / girase hitendrasing a.

select * from Employees where Salary in (select top 1
salary from (select distinct top 2 salary from employees
order by salary desc) order by salary asc)

Is This Answer Correct ?    5 Yes 2 No

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

Answer / bhaskar reddy thamma

SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT
(DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);

Is This Answer Correct ?    2 Yes 0 No

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

Answer / n.tejaswi

Select Empname
from emp LIMIT 2
orderby empsal;

Is This Answer Correct ?    2 Yes 1 No

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

Answer / khurram

The Simplest, easy, Understandable solution is

select max(sal) from emp where
sal not in
(select distinct Top 1 sal from emp order by sal desc)


Go Check Out for yourself
[replace "top 1" by "top 2" to get 3rd highest sal]
[replace "top 1" by "top 3" to get 4th highest sal] so on..

Is This Answer Correct ?    2 Yes 1 No

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

Answer / jyo

select salary from employee where salary>1st

Is This Answer Correct ?    3 Yes 2 No

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

Answer / ujwlala

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

Is This Answer Correct ?    2 Yes 1 No

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

Answer / satish

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

Is This Answer Correct ?    2 Yes 1 No

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

Answer / ashutosh singh

select distinct(a.Sal) from emp a where &n=(select
count(distinct(b.Sal)) from emp b where b.Sal<a.Sal)

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Automation Testing AllOther Interview Questions

What are principles of good testing scripts for automation?

0 Answers  


Can test automation improve test effectiveness?

0 Answers  


What is a framework and what are the frameworks available in rc?

0 Answers  


Could someone educate me on automation testing process followed in a company. I have a vague idea, but i need concrete answers. And thank you all in advance.

0 Answers  


Tell me what are pros and cons of automating tests at ui layer?

0 Answers  


Please explain what is a relative xpath?

0 Answers  


worksoft automation tool how do you create process ?

1 Answers  


Explain what is a relative xpath?

0 Answers  


What is a ‘test plan’? What is a ‘test case’?

0 Answers  


How to download QTP 9.5 Trail version? please explain the complete process?

0 Answers  


IN AN APPLICATION HOW DO YOU IDENTIFY THE TASKS WHICH SHUD BE DONE MANUALLY AND WHICH SHUD BE AUTOMATED?

0 Answers   TCS,


22. Scenario: There are 1 to 100 numbers. Each number should be keep in the each column like from A column to Z column ie 1 to 26. From 27 to 52 should be in 2nd row in the excel sheet. This has to be continue till 100. How do you write Java program and what are various methods.

0 Answers  


Categories