SELECT * FROM
(SELECT TITLE FROM MOVIE ORDER BY RANK DESC)
WHERE ROWNUM > 4;
when i run the above query .it produces output as NO ROWS
SELECTED.why ?plz any one help me
Answer Posted / vamsi krishna
the reason behind this is rownum will be generated only
after selecting the row from the table.hence when you are
using inline views ,the outer select statement is having a
rownum and inner select statement is having a rownum,so due
to the ambiguity your query is not working.
i give the following change to ur query.
SELECT * FROM
(SELECT rownum as r1,TITLE FROM MOVIE )
WHERE r1 > 4;
| Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
How to add a new column to an existing table with a default value?
What is a nvl function? How can it be used?
Explain oracle left join with an example?
How to select all columns of all rows from a table in oracle?
What is concurrency in oracle?
How to insert a new row into a table in oracle?
What is enter substitution variable in oracle?
Is insert autocommit in oracle?
Explain mutating triggers.
What is the difference between online and offline backups?
Can we convert a date to char in oracle and if so, what would be the syntax?
Explain enable novalidate constraint.
What are oracle functions?
How can you use check constraints for self referential integrity?
Briefly explain what is literal? Give an example where it can be used?