Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help me, please
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
![]() |
![]() |