how to retrieve the top 3 salaries of the table using rownum
Answer Posted / phantom coding
select * from (select rownum as rnum,t.* from emp order by
sal desc) a where rnum < 4
the alias to rownum (i.e:rnum) should be used. If rownum is
used for the constraint then the query would return the
first three rows it hits and the results could be wrong.
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is nosql db?
What is sql stand for?
What is trigger in pl sql?
What is bulk collect in pl sql?
What are the ways on commenting in a pl/sql code?
How do you select unique values in sql?
What is a unique key?
Which tcp/ip port does sql server run on? How can it be changed? : Sql dba
Can you have more than one key in a database?
What are synonyms in sql?
what is user defined functions? : Sql dba
what tools available for managing mysql server? : Sql dba
What is where clause in sql?
What is exit statement?
What is the difference between cluster and non-cluster index?