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...


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

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

Answer / guest

select top 1 salary from(select Distinct top 2 salary from
employee order by salary desc)order by salary

Is This Answer Correct ?    1 Yes 1 No

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

Answer / a sameer

By using alias name too we can generate the query
A and B are two alias name for the employee table name

Query:-

select A.* from employee A where N=(selet count(Distinct
B.sal) from employees B where B.Sal > A.sal);


If any one want 2 or any other salary jut replace "the no."
required in place of N, to get the answer.


Hope might understand

Is This Answer Correct ?    1 Yes 1 No

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

Answer / rafi

Select * from (Select emp.*.dense_rank()over (order by sal
desc) a from emp) where a=&n;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Manual Testing Interview Questions

Hi, I got an offer with maveric systems and I have around 3.5 years of work experience. But inspite of that they are asking to sign a bond for 2 years and to pledge all the original certificates for that bond. Can anybody please advice me whether its a good company or not and can i go ahead with this?

4 Answers   Marveric,


What are the various techniques in black box testing?

0 Answers  


How to measure test effectiveness?

0 Answers  


What is difference between testing tool and tracking tool? Give example for both tools? whether QTP is testing or tracking tool?

1 Answers  


What r the input documents to the design test cases?

7 Answers   Covansys,


What type of testing process do you follow in current organisation?

3 Answers  


What is the format for accentence testing. please answer me ASAP

1 Answers   ADP,


What are the differences between V-Model and Agile Model?

1 Answers   Mind Q Systems,


In simple steps how will you do unit testing using VSTS?

0 Answers   QuestPond,


what are the UAT bugs...why they come ??

2 Answers   Satyam,


How do you measure a quality of the product ?

1 Answers  


10.List five words that best describe ur strengths?

1 Answers   VJIL Consulting, Wipro,


Categories