how 2 find out nth salary.plz write sql qurires

Answer Posted / shankar

Hi...
here is the query to find out the n'th maximum salary

note: 1.'emp' is Table name & 'sal' is column name.
2.'distinct' is used for finding the unique value
3.'count' is for counting the values.

Query:
------

SELECT * from emp
where sal = (SELECT distinct(sal) from emp x
where &n = (SELECT count(distinct(sal)) from
emp where sal >= x.sal));

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why QA team is necessary for an organization?

2617


HI can i know who is taking real time testing classes in banglore? i am preparing to put 3+year experience in testing if possible anybody give suggestions for preparing 3+exp

1481


can anybody send the project you have tested with the clear descriptions,and recent bugs u found in that

1697


which test strategy your are fallowing in your company?which documents u r using in software development life cycle?

1827


Diffrence b/w functional testing,functionality testing,system testing?

1612






1. what is a date guidelines ?

1659


what is independent question and what is retriewing and what is problem of severity.

1419


when database testing comes into manual tesing

1766


how will you test transfer funds module...explain in detail

1172


How to find that tools work well with your existing system?

1605


What r the documents required for performance testing

1812


hello there, can anyone tell me what type of question does lg soft company ask in written test especially for a quant part? Thanku

1406


What is an end-to-end testing?

629


What is the difference between GUI Testing,UI testing and Usability TEsting

1951


Can you please explain about the erp project

1422