how to get second highest salary from a employee table and
how get a 5th highest salary from a employee table?

Answer Posted / dinesh

select * from emp e where
2 =(select count(distinct sal) from emp where e.sal<=sal)
or 5=(select count(distinct sal) from emp where e.sal<=sal);

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of sas functions?

603


What is the difference between INPUT and INFILE ?

751


what is data access? : Sas-di

599


what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi

548


Explain the difference between using drop = data set option in set and data statement?

677






how does sas handle missing values in functions? : Sas programming

597


What is your favorite all time computer book? Why?

2044


how can you import .csv file in to sas? : Sas programming

632


how sas deals with business intelligence? : Sas-bi

580


what is function of retain statment

1521


how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?

2287


what is the difference between calculating the 'mean' using the mean function and proc means? : Sas programming

623


what is the difference between floor and ceil functions in sas? : Sas-administrator

697


What is by-group processing?

572


what is metadata? : Sas-bi

595