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 do you increase the OS limitation for open files (LINUX and/or Solaris)?
Explain an integrity constrains?
what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?
Describe varray?
How to define a sub function?
What is a synonym? What are its various types?
What are the attributes that are found in a cursor?
How are extents allocated to a segment?
How to define a record variable to store a table row?
What is the effect of setting the value "all_rows" for optimizer_goal parameter of the alter session command? What are the factors that affect optimizer in choosing an optimization approach?
Can any one explain me when i execute below query.. select months_between('07-JUL-12','10-FEB-12') from dual; Out put:- 4.90322581 How oracle calculate?
Please explain joins in oracle?
What is the difference between view and materialized view in Oracle?
How to shutdown your 10g xe server?
What is an oracle database table?