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: newbie question about rownum

Re: newbie question about rownum

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Wed, 26 Aug 1998 19:24:22 +0200
Message-ID: <6s1gab$imj$1@pascal.a2000.nl>


>Create a view of your sql statement, you cant use Order By in a view, but
you
>can GROUP BY <name> and it will do an order by.

>Then you select * from view_name where rownum<10;

You may do the same, without actually defining a view, using a subquery:

    select temp.*
    from

      ( select *
        from my_table
        where ...
        order by ...
      ) temp

    where rownum < 10;

Arjan. Received on Wed Aug 26 1998 - 12:24:22 CDT

Original text of this message

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