a query to select maxmun 3 salaries of employee table

Answer Posted / suresh babu

select * from employees a where 3 <= select count(distinct
b.salary) from employees b where a.salary >= b.salary);

This query,which returns the first maximum salary from
employees table.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is parameterized cursor in oracle?

578


Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.

1260


What is a view and how is it different from a table?

574


what are bitmap indexes? How does they work?

1719


When do we use group by clause in a sql query?

571






How to update values in a table in oracle?

579


1) WIll all the user get the DEFAULT profile, if their current profile got deleted at any point of time? 2) What are the Situation we need to MOVE the TABLE between T.spaces? 3) What is the use of MOVING the TABLE between SCHEMA'S? 4) What are the Table Clause, Segment Clause and the Datafile Clause which will override each other? 5) Explain SORT_AREA_SIZE of Tempfile to make UNIFORM SIZE

1589


What are the execution control statements?

621


What is the difference between the Oracle ODBC driver and a Microsoft ODBC (Open Database Connectivity) Driver?

619


Explain the use of Merge statement in oracle 11g

598


Explain the truncate in oracle?

549


What happens to the data files if a tablespace is dropped?

576


How can I combine multiple rows into a comma-delimited list in oracle?

583


Explain what are clusters?

616


22. Display the order number, number of lines in the order, total number of items and total value for all orders that have a total value greater than $100

1606