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

Explain Functionality Testing Techniques

2 Answers   Target,


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.

1 Answers   Satyam,


what is stub?Explain in testing point of view?

13 Answers   MBT,


What is the role of the test group vis-?is documentation, tech support, and so forth?

0 Answers  


What is way of writing testcases for database testing?

1 Answers   Crea,


Hello everybody, How many people do you think one sprint team can have in average?

0 Answers  


Are all special characters are used in email id? My question is - If I enter *,#$ in email id should it accept?

1 Answers  


How we test an ERP products? and wat approach we will fallows and wat r the tools avaliable for ERP testing?

2 Answers   Midas Technologies,


Which is the better way to explain tipical bug life cycle?

4 Answers  


what is impact analysis?....and base line version?...

3 Answers  


Can anyone explain the terms: Black-box, functional, Regression, Back-end, System Integration, GUI, UAT stress and Load Testing.

1 Answers  


What is System Testing Phase? Which types of testing will be conducted in system testing phase?

1 Answers  


Categories