write a query to find 4th max salary

Answer Posted / nishi.swain@gmail.com

select distinct sal from table_name t1 where 4=(select count(distinct sal) from table_name t2 where
t1.sal<=t2.sal);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different type of joins in sql?

540


What is the difference between function, procedure and package in pl/sql?

556


What is pls_integer in pl sql?

536


Does truncate remove indexes?

555


Can we create index on primary key?

522






what is the stuff function and how does it differ from the replace function? : Sql dba

615


Can we join more than 2 tables in sql?

487


Can you call pl/sql package functions from within a fast formula?

560


What is a schema sql?

529


What are sql data types?

543


What are the types of queries in sql?

515


how can we know the count/number of elements of an array? : Sql dba

568


how to convert dates to character strings? : Sql dba

533


How consistent is the view of the data between and within multiple sessions, transactions or statements ?

1704


What is the difference between database trigger and stored procedure?

549