how 2 find out nth salary.plz write sql qurires

Answers were Sorted based on User's Feedback



how 2 find out nth salary.plz write sql qurires ..

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

how 2 find out nth salary.plz write sql qurires ..

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

how 2 find out nth salary.plz write sql qurires ..

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

how 2 find out nth salary.plz write sql qurires ..

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

how 2 find out nth salary.plz write sql qurires ..

Answer / sud_aj

Nth Highest salary:

Select Min (salary) from Employees
where
salary IN (Select TOP n salary from Employees order by salary DESC)
Here n= any number

Is This Answer Correct ?    0 Yes 0 No

how 2 find out nth salary.plz write sql qurires ..

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

how 2 find out nth salary.plz write sql qurires ..

Answer / nagapawan

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

how 2 find out nth salary.plz write sql qurires ..

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

Post New Answer

More Manual Testing Interview Questions

Can you tell me some thing about source code testing tools?

2 Answers   Infosys,


Which type of testing is most imp. from black box and White box?

2 Answers   eZest,


wat is perpose of TRM ?(Test responsibility Matrix)

4 Answers   Synergy,


why feature not to be tested in test plan

4 Answers   CTS,


expalin with ex high priority high severity, and low sev low prioority? brahma412@yahoo.co.in July 24

3 Answers   CTS, Wipro,






Any Tools to test the performance of SQL Database?

2 Answers  


What are the meetings conducted your company

1 Answers   Satyam,


could u pls anyone tel me .."which is the best instute that provides eficient practical knowledge and also real-time oriented knowldge to do a project in manual and automation testing..in hyd" pls send me to dis mail-id if u find any..? sinducute17@gmail.com

0 Answers  


i want to take the questions of software testing of QA infotech company

0 Answers   Infotech,


can anyone please clearly tell me about test scenario,test script&test case.in which levels v prepare all these?

1 Answers  


Any body can answer Any Test engineer found any critical defect in his Testing career. anybody can let me know. Thanks in avance.

3 Answers   iFlex,


How do you estimate white box testing?

0 Answers  


Categories