adspace


Write a query to find five highest salaries from EMP table.
(there is a column SALARY)

Answer Posted / sarath

select ename,sal,SAlrank from(select ename,sal,dense_rank()
over(order by sal desc) Salrank from emp)
where salrank <=5

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I remove duplicates in two columns?

1202


Is inner join faster than left join?

1289


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

2102


Do we need to rebuild index after truncate?

1156


Is primary key clustered index?

1028


what is collation? : Sql dba

1242


what are aggregate and scalar functions? : Sql dba

1142


how to use regular expression in pattern match conditions? : Sql dba

1125


how many tables will create when we create table, what are they? : Sql dba

1157


Does group by remove duplicates?

1122


what is sql server agent? : Sql dba

1190


define sql insert statement ? : Sql dba

1110


how to start mysql server? : Sql dba

1279


What is the current version of sql?

1106


what is dbms? : Sql dba

1072