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: Help me, please

Re: Help me, please

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Thu, 22 Apr 1999 20:35:55 +0200
Message-ID: <7fnq5t$8e4$1@weber.a2000.nl>


Gennady
> How to store a query result in a table if the query
> includes ORDER BY ?

Hmmm, you need to tell us a bit more.

The order by does not at all influence the things you can do with Oracle. I doubt that this is what you want, but anyway:

    insert into my_table( my_number, my_date )

        ( select a_number, a_date
          from my_other_table
          order by a_number, a_date
        );

Now, if you want to have the same order when you select from my_table, you should use order by again:

    select my_number, my_date
    from my_table
    order by 1, 2;

Or maybe you want an order by in a view. You cannot do that, but you may use group by to get the results ordered anyway:

    create or replace view my_view as

        select my_number, my_date
        from my_table
        group by my_number, my_date;

However, Oracle views are not stored in a table. I really do not understand what you want...

Arjan. Received on Thu Apr 22 1999 - 13:35:55 CDT

Original text of this message

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