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


Please Help Members By Posting Answers For Below Questions

What is recycle bin in Oracle?

709


What is merge statement used for?

561


How to use "out" parameter properly?

626


what is the difference between data migration and production migration.

1803


please explain.. DB architecture ...

1554






Describe an oracle table?

565


What are the various constraints used in oracle?

547


How to get a create statement for an existing table?

569


How to connect ms access to oracle servers?

544


Hi Can any one tell me what are the API's used in requisition import.

1481


Explain a segment?

610


What is define in oracle?

561


definition of cluster and non-clustered index?

2475


What is an oracle?

570


What is an Oracle index?

1171