how 2 find out nth salary.plz write sql qurires
Answers were Sorted based on User's Feedback
Answer / jethva_trupti
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP N salary
FROM dbo.empsalary
ORDER BY salary DESC) a
ORDER BY salary
where N can be any number
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / suresh yadav
select * from emp where &n=(select count(distinct(sal))from
emp b where emp.sal<=b.sal);
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ramthiraviyam
In MySQL ,
we can get the nth salary using LIMIT IN MySQL Query .
Example:
if you want to take 7 th largest salary From emp table,
SELECT salary FROM emp order by salary desc LIMIT 6,1
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ganesh thik
select * from employee emp1 where 2=(select count (emp2.salary))from employee emp2 where emp2.salary>emp1.salary.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / yogini_bhosale
select MAX (salary from employee)
where
salary not in ( select TOP N+1 salary from employee)
ORDERBY salary desc();
| Is This Answer Correct ? | 0 Yes | 0 No |
iam taking table name as emp. this is to find out nth salary
eg: select * from emp
where n-1 = (select count(*) from emp e
where emp.salary<e.salary)
in place of n-1 you can keep zero for first hight salary
and 1 for second hightest salary.....etc
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / kishore
SELECT [column_list], ROWNUM
FROM (SELECT [column_list]
FROM table
ORDER BY Top-N_column)
WHERE ROWNUM <= N
| Is This Answer Correct ? | 0 Yes | 1 No |
what is difference between waterfall model and vmofel?
Is it possible to have a defect with high severity and low priority and vice-versa i.e high priority and low severity? Justify,if possible? give a example?
How do you determine user load for a performance test of a Web application?
What r the risks involved in testing?
1.Test cases for Password cannot be used for next 13 times? 2.Test cases for Password should not be less than 8 to 13 chars and there should be at least one special character and one Capital letter.
What are testing techniques? What is difference between general and specific?
how far unix is useful in testing,what the interviewers going to ask in UNIX,how much we have to learn i.e what are the concepts that we have to learn for interview purpose? plz send me the answer
explain v- model? why we call this model as v-model, not an u-model?
Hi Friends, What are the steps involved in STLC
i have worked in 11 month duration project. interviewed person asked me for wat purpose you worked in that project and wat you worked. you worked for a long time in one project. its loss for the company you worked.
what is the role of test engineer while doing unit and integration testing. unit and integration testing is already done by developers
can u explain about iteration model? And what is it?