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
Can variables be used in sql statements?
What is acid property in a database?
What is sql stand for?
What is pl/sql table? Why is it used?
Is sql dba a good career? : SQL DBA
what are null values? : Sql dba
Mention what is the function that is used to transfer a pl/sql table log to a database table?
What is a sql schema used for?
What is application trigger?
Define SQL and state the differences between SQL and other conventional programming Languages?
When are we going to use truncate and delete?
What is the size of partition table?
What is a unique constraint?
What are the differences between in and exists clause?
How do I find duplicates in a single column in sql?