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 pl/sql package consists of?
What are the steps for performance tuning.
What is acid property in a database?
how many ways to get the current time? : Sql dba
Can a key be both primary and foreign?
Explain the difference in execution of triggers and stored procedures?
How to run sql*plus commands in sql developer?
Is coalesce faster than isnull?
Why do we use triggers?
Can primary key be changed?
What is the use of desc in sql?
Is pl sql different from sql?
how to start mysql server? : Sql dba
what is a foreign key ? : Sql dba
Where are my tempfiles, I don't see them in v$datafile or dba_data_file?