how to retrieve the top 3 salaries of the table using rownum
Answer Posted / nilesh
You can also use a query like
select e.ename,e.sal from emp e where 3>(select count
(distinct(b.sal)) from emp b where b.sal>e.sal)
as explained by Kalyan Kumar in Answer 2 and for making
it parameterised u can replace 3 by &sal so that when it is
executed it will ask you a number
if you enter 3 it will give you best three salaries , if
you enter 4 it will give you best 4 salaries etc.
| Is This Answer Correct ? | 9 Yes | 3 No |
Post New Answer View All Answers
how to return query output in html format? : Sql dba
What is parameter substitution in sql?
What is data abstraction in sql?
List and explain the different types of join clauses supported in ansi-standard sql?
What is a procedure in pl sql?
How show all rows in sql?
What is dml statement?
Mention what does plv msg allows you to do?
What is use of trigger?
Why procedure is used in sql?
What does select * from mean in sql?
What is sql entity?
What are sql indexes?
How many types of keys are there in sql?
What is a sql schema used for?