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 to find the fifth highest salary?

Answers were Sorted based on User's Feedback



how to find the fifth highest salary?..

Answer / chandra shekhar

Assuming that EMP table with Sal column

SELECT MIN(sal) FROM
(SELECT DISTINCT sal FROM emp WHERE
ROWNUM < 6
ORDER BY sal DESC )

- If fifth highest then ROWNUM < 6
- If n'th highest then ROWNUM < n+1

Regards
J

Is This Answer Correct ?    11 Yes 5 No

how to find the fifth highest salary?..

Answer / soumen saha

select max(sal) from table where level=5 connect by prior
sal>sal;

Is This Answer Correct ?    5 Yes 2 No

how to find the fifth highest salary?..

Answer / saraswathi muthuraman

SQL> select * from emp_test order by sal desc;

1003 20010 11
1001 10000 11
1001 10000 11
1002 100 11
1004 99 11
1005 50 11
1006 25 11

SQL> select * from (select emp_no,dep_no,sal,rank() over
(order by sal desc) as rank_list from emp_test) where
rank_list =5;

1004 11 99 5

Is This Answer Correct ?    5 Yes 5 No

how to find the fifth highest salary?..

Answer / saraswathi muthuraman

Try this :

SQL> select * from (select emp_no,dep_no,sal,rank() over
(order by sal desc) as rank_list from emp_test group by
emp_no,dep_no,sal) where rank_list =5;

1005 11 50 5

This seems to be a correct answer if few employ having same sal

Is This Answer Correct ?    2 Yes 2 No

how to find the fifth highest salary?..

Answer / srinu

SELECT MIN(SAL) FROM(SELECT TOP 5 * FROM EMP ORDER BY SAL
DESC) AS MIN_SAL

Is This Answer Correct ?    1 Yes 2 No

how to find the fifth highest salary?..

Answer / nagireddy karri

select min(emp_sal) from (select (Emp_sal) from(select
Emp_sal from emp order by emp_sal desc) and rownum<=5)

Is This Answer Correct ?    0 Yes 1 No

how to find the fifth highest salary?..

Answer / soni

select MIN(salary) from (select distinct salary from employees
order by salary desc) where ROWNUM < 6 ;

ITS SELECTING from employees table 5th highest salary

Is This Answer Correct ?    3 Yes 5 No

how to find the fifth highest salary?..

Answer / arun

Select max(Employee_Sal) From Employee where Employee_Code
in(Select Top 5 Employee_Code,Employee_Name,Employee_Sal
From Employee Order by Employee_sal desc)

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More DB Architecture Interview Questions

What is database architecture? : sql server architect

0 Answers  


What is a Database system?

0 Answers  


Does storing of data in stored procedures increase the access time? Explain?

0 Answers  


What is E-R model?

0 Answers  


What is RDBMS KERNEL?

0 Answers  


What is "transparent DBMS"?

0 Answers  


State about the security aspects of stored procedures?

0 Answers  


How many types of stored procedure?

0 Answers  


Can somebody helps me to arrange these into ascending order depending on their sizes: 1)OLTP 2)ODS 3)DWH 4)DATA MART

2 Answers   Wipro,


What is a view? How it is related to data independence?

0 Answers  


What is the job of the information stored in data-dictionary?

0 Answers  


What is DDL Interpreter?

0 Answers  


Categories