write a query for the fifth highest salary?

Answer Posted / piyush gupta

select distinct(a.sal) from emp a where 5=(select
count(distinct(b.sal)) from emp b where a.sal<=b.sal)


you can this query for nth highest salary
replace 5 with any number

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Source File: Target EMPNO, SAL Empno, Format 101, 1000 101, 1000 101, 1100 101, 1000, 1100 101, 1000 101, 1000, 1100, 1000 101, 10000 101, 1000, 1100, 1000, 10000 102, 1100 102, 1100 102, 1300 102, 1100, 1300 102, 1200 102, 1100, 1300, 1200 102, 1500 102, 1100, 1300, 1200, 1500 How can i get that output using datastage(ETL) tool

1432


Explain normalization in one line?

642


issues involved in modeling and building data werahouses

1560


Is redis in memory database?

543


How many types of locks are present in a database?

610






Re: Where can i get informatica certification Exam dumps and details? please forward it to emailid:

1817


What is a Database?

597


What happens when shared and exclusive locks are applied on data item?

597


Explain entity type?

631


What the various ways to tune a teradata query

2795


How do you connect to a database?

610


What is the relationship that exists inside in E-R diagram?

635


What is a sequence? Explain it with one example?

651


I have single column in a file. Input 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 my output is file 1 have 1,2,3,10,11,12 file 2 have 4,5,6,13,14,15 and file 3 have 7,8,9 how is it possible in datastage

1196


What is ole db in ssis?

616