Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Create table as ...
You have to create a table something like
create table a as select * from b where 2=1; insert into a select * from b order by something;
/Joachim
Wei Tang <wtang_at_cs.ualberta.ca> wrote in article
<69ovpt$qdj$1_at_scapa.cs.ualberta.ca>...
> Hi, there:
>
> I wonder if anyone of you ever used "create table as subquery" statement
> to create a table.
>
> I have a table called test:
> create table test(
> name varchar2(10),
> ID number);
>
> But I cannot use the following statement:
> create table test_bak as select * from test order by ID;
>
> It said: ORA-00933: SQL command not properly ended.
>
> When I remove the "order by" clause, everything is fine. I couldn't find
> any documentation saying "order by" is not supported in "create table
> as..." statement.
>
> What's wrong with that?
>
> I need your expertise in a rush. Please help me.
>
> Thanks.
>
>
Received on Tue Jan 20 1998 - 00:00:00 CST
![]() |
![]() |