Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Insert from another table...Create with ORDER BY
Your suggestion will not work if you are using parallel query option
and the create table goes parallel.
One possible solution is to create an index on the required column
then force its use via a hint:
create as select /*+ index(tab, ind) */ from ....
Eric & Carole Kamradt <kamradt_at_inconnect.com> wrote in article
<33EB0D10.CE57AF05_at_inconnect.com>...
> A small trick I just figured out.
> You don't seem to be able to use the ORDER BY clause
> in a CREATE TABLE x AS SELECT ...
> or in a INSERT INTO TABLE x SELECT ...
> but you can use a GROUP BY
> so if you use a set of columns that is unique like (txnum, txtotal,
> counter_field)
> then you can say
> CREATE TABLE x
> AS
> SELECT *
> FROM sourceTable
> GROUP BY txnum, txtotal, counter_field;
> or
> INSERT INTO x
> SELECT *
> FROM sourceTable
> GROUP BY txnum, txtotal, counter_field;
>
> see if that doesn't work for you
>
> Good Luck
> Eric Kamradt
>
Received on Fri Aug 08 1997 - 00:00:00 CDT
![]() |
![]() |