Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

If you open a bug in build -1 and that get closed in build-2 . Again the same bug a raised in build -3. Then what state will you give to that?

6 Answers   TCS,


what is defect tracking?

6 Answers  


I hope so many people are using gmail accout. My basic question is the defference between gmail and other mails.

2 Answers  


I am a B.COM graduate. I have studied all the theorotical aspects of manual testing. How can i get in to testing without practical exp. And even if i manage to get a job, i want to know whether i will be able to do my job, being i am new to software field.

2 Answers   Emphasis,


hi friends, anybody WHO NEEDS PROPER GUIDANCE TO MAKE CARRER IN TESTING PLS CONSULT ME. U WILL DEFINITELY BE BENEFITTED. My EMAIL ID: sun2k8@rediffmail.com Test Lead (IBM) +919902925787

8 Answers  






How do u make sure the test cases are not repeated?

3 Answers   Aspire,


(hi friends : please give me reply soon ) i have completed my software testing course , now am planning to put a fake of 1.5 yrs, i need two projects to put in my resume , if anybody has any real time experience and those who handled a project( 6-8 months )in the telecom domain ,please send me the details regarding the project ...it will a great help for me ..if u have suggestion let me know ....

5 Answers  


The program prints data on the screen instead of the printer. Referring to the fault above, which load condition errors has occurred?

2 Answers  


Explain the STLC?

32 Answers   Accel Frontline, Fidelity, Infosys,


On which basis u'll prepare the test cases.

6 Answers   Semantic Space,


Wht is the Throughput in performance testing during web based testing, Generally how do we test this..do we use any tool etc....Anybody can explain it in detail...

16 Answers   Siemens, Symphony,


what is integration testing technique(like topdown,bottomup and hybrid)explain me friends

2 Answers  






Categories