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 the steps for preparing scenario ?
What does entry and exit criteria mean in a project?
Whether we write one test case for one use case?
What steps are needed to develop and run software tests?
Test Case Design Techniques like BVA, Equalance partitioning, Error guessing?
Whenever the project is at maintenance phase the client will be using his own data- is the same data given to the test engineers or any other dummy data
Testing Application means what? I want the actual meaning of application?
HI, i did MCA and i took coaching for testing and now iam trying to get job.but whenever i see any job requirement they r asking for minimum 3 yrs of experience and many other pgmming languages like java,c++,perl,shell,database like unix,linux.my question how can one have experience without getting job and how one can know so many(pgmm lnguages).iam afraid to keep fake experience and cannot answer as i did the project.so some one pls suggest me how should i proceed ..thx in advance.
How the value of P in cyclomatic complexity is calculated? P:The number of connected path.
What is the most important phase in STLC and Why
Explain some techniques for developing software components with respect to testability.
is smoke and sanity testing is same? Please clear this doubt.