Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Rownum

Re: Rownum

From: Sue French <sfrench_at_tcp.co.uk>
Date: Tue, 4 May 1999 20:12:31 +0100
Message-ID: <hFHX2.292$vO1.21289@news.tcp.co.uk>


Hi again,

Thanks to all who responded.

However, I've have tried several of these and they all work fine, as long as there is no ORDER BY clause. In order for the results to be returned correctly, the ORDER BY clause would need to be in the main query and the sub query.

As soon as I try to do that, I get an error, e.g.

              1  select id, surname, first_name from
              2     (select id, surname, first_name, rownum rn
              3           from telephone_directory where rownum < 15
              4           order by first_name)
              5  where rn > 7
              6* order by first_name
            SQL> /
                     order by first_name)
                     *
            ERROR at line 4:
            ORA-00907: missing right parenthesis

If I miss off the second ORDER BY, the results are wrong.

The application is such that the web user selects the order that the results are returned, and the SQL statement is built dynamically in the JavaScript.

Sue



Visit me at http://homepages.tcp.co.uk/~sfrench/ See you there! Received on Tue May 04 1999 - 14:12:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US