consider a table which contain 4 columns,ename,eno,sal and
deptno, from this table i want to know ename who having
maximum salary in deptno 10 and 20.

Answer Posted / ashim

select * from (select id,dept,sal,dense_rank() over
(partition by dept order by sal desc) p from a_tab1)
where p=1

....by using this program we can find out the nth salary of
different department jus give p=n

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of functions are there in sql?

669


How do I view output in sql developer?

815


How do I run a pl sql program?

803


what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

747


What is right join in sql?

745


How to create a menu in sqlplus or pl/sql?

814


Can %notfound return null after a fetch?

761


What is a database? Explain

793


Explain the insert into statements in sql?

735


what are the differences between binary and varbinary? : Sql dba

725


How long it takes to learn pl sql?

725


What is optimistic concurrency control? : Transact sql

753


What is sharding in sql?

739


What is minus?

758


How show all rows in sql?

800