how 2 find out nth salary.plz write sql qurires
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Explain Functionality Testing Techniques
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.
what is stub?Explain in testing point of view?
What is the role of the test group vis-?is documentation, tech support, and so forth?
What is way of writing testcases for database testing?
Hello everybody, How many people do you think one sprint team can have in average?
Are all special characters are used in email id? My question is - If I enter *,#$ in email id should it accept?
How we test an ERP products? and wat approach we will fallows and wat r the tools avaliable for ERP testing?
Which is the better way to explain tipical bug life cycle?
what is impact analysis?....and base line version?...
Can anyone explain the terms: Black-box, functional, Regression, Back-end, System Integration, GUI, UAT stress and Load Testing.
What is System Testing Phase? Which types of testing will be conducted in system testing phase?