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 / sirish kumar

Select max(salary)from(select salary from employee where
salary not in(select max(salary)from employee))

Is This Answer Correct ?    0 Yes 0 No

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

Answer / rahul koul

Select MAX(SALARY) from EMP where SALARY NOT IN (SELCT MAX
(SALARY) from EMp)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / saima

1.
SELECT * TOP 1 from
(Select Top 2 from employee Order By Salary desc)
order By salary desc

2.
SELECT * from
(Select Top 2 from employee Order By Salary desc)
where salary <max(salary).

Is This Answer Correct ?    0 Yes 0 No

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

Answer / amit rajput

Select Min(NetAmount) from (Select Distinct Top 9 NetAmount
from vw_im order by NetAmount desc) a


This will give you 9th highest Salary

Is This Answer Correct ?    0 Yes 1 No

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

Answer / sisara bharat

SELECT max(salary) FROM Employee WHERE Employee.salary <
(SELECT max(salary) FROM Employee)


Plz reply if anyone having generic answer. :-)

Thanks

Is This Answer Correct ?    0 Yes 1 No

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

Answer / biswojit kar

Getting nth max sal of an Employee.

select sal from (select ename,sal, dense_rank() over(order
by sal desc nulls last) as rank from emp) where rank=n;

Here n = 2 for 2nd highest sal, 3 for 3rd highest sal, 4
for 4th highest sal and so on.One can use rank() in place
of dense_rank(), but the demerit of rank() is as follows:
Let you want to see 3rd highest sal.
Suppose 2 employees have 2nd highest sal, then rank()
assigns both of them rank 2, then it leaves a gap and
assigns the emp with 3rd highest sal to rank 4.
So, when you use the above query with rank(), the you donot
get the 3rd highest sal. Try retrieving 3rd highest sal in
emp table in scott user, using both rank() and dense_rank
(), and mark the diff. Thanks!

Is This Answer Correct ?    2 Yes 3 No

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

Answer / tausif

select top 2 * from Employee order by salary desc

Is This Answer Correct ?    1 Yes 2 No

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

Answer / prem

select max(sal) from employee where sal<(select max(sal)
from employee)

Is This Answer Correct ?    0 Yes 1 No

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

Answer / parul

SELECT MAX(A.SALARY) AS MSAL
FROM EMP A
WHERE
(SELECT MAX(B.SALARY) AS M1SAL
FROM EMP B) < MSAL
AND A.SALARY = B.SALARY;

Is This Answer Correct ?    2 Yes 4 No

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

Answer / vikash

--SUPPOSE PRICE IS SALARY

SELECT
TOYNAME,TOYPRICE FROM TOY
WHERE TOYPRICE<(SELECT MAX(TOYPRICE) FROM TOY)ORDER BY
TOYPRICE DESC LIMIT 1;

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More Automation Testing AllOther Interview Questions

We have a testing assignment that is time-driven. Do you think automated tests are the best solution?

0 Answers  


What is the difference between automation tools and management tools?

0 Answers  


How to check if an element is visible on the page?

0 Answers  


What is the purpose of the testing?

12 Answers   Satyam,


Do you know what is the purpose of creating a reference variable- 'driver' of type webdriver instead of directly creating a firefoxdriver object or any other driver's reference in the statement webdriver driver = new firefoxdriver();?

0 Answers  


is there any one got offer from snapdeal?

0 Answers  


What all things can you automate?

0 Answers  


WHAT IS THE BEST WAY TO CHOOSE AUTOMATION TOOL?

8 Answers   IBM,


Can anyone tell me the correct answer of below question....it is about Bugzilla tool. When bug will find out at the time of executio where it will save or what is the location of bug??

0 Answers   Diya,


How could the web element attributes be inspected in order to use them in different locators?

0 Answers  


Give some examples for defect management tools?

0 Answers  


I was asked these questions during a job interview question. I totally stumbled on # 1 and for # 2 even though I answered but not a very convincing way. I would appreciate a concise and well phrased asnwers: 1) During SDLC, when would you be asked to take it "offline" 2) Throughout SDLC process, where would you implement test automation and why?

0 Answers  


Categories